06-15-2010 09:14 PM
Hi,
We are developing a BlackBerry Widget that uses web-services. The calls to the webservices are done with XMLHttpRequest and Basic Authentication.
In the simulator, we are able to get a success response, but on the device we get an error 401. Here's an example of the code:
var request2 = new XMLHttpRequest();
request2.open("POST",url, true);
request2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request2.setRequestHeader("Content-length", postData.length);
request2.setRequestHeader("Authorization","Basic hash");
request2.setRequestHeader("Connection", "close");
request2.onreadystatechange = function() {
if (this.readyState == 4) {
alert(this.readyState + ": " + this.status);
}
};
request2.send(postData);
The data sent is small (less than 1KB).
It sound similar to other posts on this forum. Are there any fixes or workarounds? Any help would be appreciated. Thanks
AJ
06-18-2010 02:24 AM
Has anyone had similar issues? Any advice would be appreciated.
06-23-2010 02:01 PM
Any thoughts or ideas? Is this a bug?
06-25-2010 10:55 AM
Hi ajgogo,
We currently don't have the support for challenge response authentication in BlackBerry Widgets.
01-29-2012 06:05 AM
Here i have problems too with AJAX request with Basic Authentication.
It is not supported yet in SDK 2.3 for Smartphone?
same code works fine with PlayBook SDK 2.2