Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 43
Registered: ‎02-05-2010
My Device: 8900
My Carrier: don't know

the resource <myurl> could not be retrieved

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

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: the resource <myurl> could not be retrieved

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

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 43
Registered: ‎02-05-2010
My Device: 8900
My Carrier: don't know

Re: the resource <myurl> could not be retrieved

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

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: the resource <myurl> could not be retrieved

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?name=widgetfeatures

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter