Setting the ACCEPT Header in Flash 9.0

I am setting the ACCEPT header in a UrlRequest, but when I inspect the inbound request to the server the ACCEPT header is set twice.  Once the default that Flash sets it to and once for my request.  Is there something special you have to do so that flash will not set the default?  What am I doing wrong?  Applicable code below.
var register_loader:URLLoader = new URLLoader();
var register_request:URLRequest = new URLRequest( path );
register_request.method = URLRequestMethod.POST;
register_request.requestHeaders = new Array();
register_request.requestHeaders.push( new URLRequestHeader("ACCEPT", "text/javascript"));
 
register_loader.load( register_request);

Open in new window

LVL 1
mynamebecory2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rascalpantsCommented:

if it is set once by flash, do you really need to set it then?

rp / ZA
0
mynamebecory2Author Commented:
Yes, flash always sets its to text/html, I need it set to text/javascript (or whatever I want it set to).  The problem is flash sets it, then when I try to set it, instead of overriding the "default" it just appends an additional Accept header.  The end result is that the server receiving the request only looks at the first Accept header, and thus sends back the wrong content type.
0
mynamebecory2Author Commented:
The headers end up looking something like this:
---------------------------------------------------------
GET / HTTP/1.1
Cache-Control: max-age=0
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Cookie: __vokle_session_id=3643559748ef191732d6764dc6aabc52
Connection: keep-alive
Host: 127.0.0.1
Accept: text/javascript (This is the one i added, above is the one flash adds)

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.