I need to make a rest api call to a website say xyx.com.
It has a usual authentication and i have implemented it in jquery.
say
return $.getJSON('xyx.com/restapi/login?userid=aaa&pass=qqq'+"&xslt=json.xsl&
callback=?",function(jsonResult)
{
if(jsonResult.response.status == 'success')
{
...
...
}
},"jsonp");
the above is working fine.
Now HT Access is provided to the above site xyx.com
I replaced the URL used in the above getJSON as follows
http://msf:sks1l*@xyx.com/restapi/login?userid=aaa&pass=qqq
where msf and sks11* are the HT Access credentials.
The above is working fine in FF but not in IE.
Any possible solutions or workarounds.
$.getJSON()is just a shorthand for a specific kind of$.ajax()call. The jQuery docs show the details: http://api.jquery.com/jQuery.getJSON/.$.getJSONis equivalent to:And looking at the
$.ajax()documentation at http://api.jquery.com/jQuery.ajax/ it says:So just use the
$.ajax()form and pass a username and password, like so: