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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
Developer
newone
Posts: 43
Registered: ‎02-05-2010
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

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,693
Registered: ‎10-16-2008
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
Please use plain text.
Developer
newone
Posts: 43
Registered: ‎02-05-2010
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

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,693
Registered: ‎10-16-2008
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
Please use plain text.