08-13-2010 02:45 AM
Hello,
when I want to make a httprequest than I get the message:
the resource <myurl> - could not be retrieved because it was not found in the config.xml.
My code:
var request = google.gears.factory.create('beta.httprequest');
request.open('POST', 'url');
request.setRequestHeader("Cookie", "String")
request.onreadystatechange = function() {
if (request.readyState == 4) {
alert(request.responseText);
}
};
request.send(null);
what is wrong?
thanx
newone
08-13-2010 09:02 AM
Is the above pseudo code??? it looks like you are wanting your url to be a variable but you are passing it as a literal string 'url' with quotes in the open function
08-23-2010 04:09 AM
Hi,
when I write the url in quotes, than i get the same failure. So I put the url into the config.xml but there is no change.
what is the problem?
thanx
newone
08-23-2010 07:26 AM
Whatever domain you're trying to request data from (i.e. http://www.blackberry.com) must be added to the config.xml <access> elements. The <access> elements are a whitelist of origins that are allowed to be communicated with inside your widget.
I believe the following video will outline this process.
http://www.blackberry.com/DevMediaLibrary/view.do?