Pretty simple:
var req:URLRequest=new URLRequest(); req.url="http://somesite.com"; var header:URLRequestHeader=new URLRequestHeader("my-bespoke-header","1"); req.requestHeaders.push(header); req.method=URLRequestMethod.GET; stream.load(req);
However, if I check traffic using WireShark, my-bespoke-header not sent. If I go to URLRequestMethod.POST and add some data to req.data , then the header will be sent, but the receiving application requires GET, not POST.
The documentation mentions a blacklist of headers that will not be sent. my-bespoke-header not one of them. It might be worth mentioning that the original request is being executed from another port in the same domain. Nothing is reported in the policy log, so this seems unlikely, but can this be fixed by forcing crossdomain.xml to be downloaded using allow-http-request-headers-from , even though this is not a crossdomain problem? Or is it just an undocumented Flash Player feature that it can only send its own headers with a POST request?
source share