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
New Contributor
Posts: 3
Registered: ‎09-23-2011
My Device: 5.0 9550
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.

Developer
Posts: 128
Registered: ‎08-01-2008
My Device: Bold 9900, 9810, 9780, 9650 and so many others
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().
New Contributor
Posts: 3
Registered: ‎09-23-2011
My Device: 5.0 9550
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?

New Contributor
Posts: 2
Registered: ‎01-04-2012
My Device: n/a
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