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
New Contributor
ricksuggs
Posts: 3
Registered: 09-23-2011
My Carrier: na

AJAX request is missing the 'Referer' request header, is there a way to set it?

I'm testing my web application on BB 5.0 simulators, it seems that every ajax request I attempt is missing the 'Referer' request header. The problem is that the web service I am calling requires it. It is added in the BB 6.0 browser, and every other browser / device I have tested. I am using jquery to submit my ajax requests. Is there any information on how to use an ajax request with a 'referer' request header in BB 5.0.

Please use plain text.
Developer
araskin
Posts: 88
Registered: 08-01-2008
My Carrier: T-Mobile

Re: AJAX request is missing the 'Referer' request header, is there a way to set it?

I haven't tried this in BB OS 5 but have you tried calling setRequestHeader()? This should be done before you call Send().
Please use plain text.
New Contributor
ricksuggs
Posts: 3
Registered: 09-23-2011
My Carrier: na

Re: AJAX request is missing the 'Referer' request header, is there a way to set it?

Thanks for the reply, however I have discovered that the w3c recommends that the 'Referer' header not be modified through javascript, and have tested that on several browsers, the setRequestHeader() method does not modify the 'Referer' request Header.

 

http://www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-setrequestheader

 

I'm looking for a solution that somehow overrides the blackberry browser's deficiency of not setting the 'Referer' header, any ideas?

Please use plain text.
New Contributor
brennanmceachran
Posts: 2
Registered: 01-04-2012
My Carrier: 4169980903

Re: AJAX request is missing the 'Referer' request header, is there a way to set it?

Hey All,

 

Has anyone found a way around this?

 

Thanks in advance

Please use plain text.