1 person found this helpful
Both Header and Cookie are special headers and they can be handled separately. For other custom headers, your code should work via the req.setRequestHeader ('header_name', 'value');
For the header, please refer to this: http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7e7b. html
htmlLoader.userAgent = agent;
For cookie header, you need to instruct the htmlLoader to not handle the default cookie jar (which means sending the default cookies associated with a url). Please refer to manageCookies property: http://help.adobe.com/en_US/AIR/1.5/jslr/flash/html/HTMLLoader.html#manageCookies
You need to call this:
htmlLoader.manageCookies = false;
Dragos Georgita | Adobe AIR Engineering
Thanks. those two headers now work.
But I also need to find a way to set the Referrer header, and I couldn't find any info on the AIR documentation.
req.setRequestHeader('Referer', 'http://www.google.com'); was not passing the header
Any possible way to do this?
I'll explain, what the code will be doing is making two http requests to the same url - and I need it to pass on the url as the referring url the second time it does this.
EDIT: having a blank request header will work just fine - I just can't have "app://html/app.html" as the referer.
How can I stop it from being sent?
AFAIK WebKit has a security policy in place to not allow you to set up the REFER header.
Is there another way to accomplish this (by passing in a different named header and the server to interpret this one)?