Actionscript URLLoader or HTTPService gets HTTP 406 error

Shame on you Adobe!

My Restful Client was working properly on Firefox but not on Chrome or IE. I had a very severe headache to fix this. At last I found the reason.

Firefox is somehow gentle to HTTP request headers. If you do something not proper it gently lets you send the request. But IE and Chrome so much serious about them. IE says “I am not joking on this header thing, give me the exact charset, exact content type and etc.”

My Restful Service’s implemantation had been done before. So I could not change the server code. I had to change the accept headers.

But wait. Flex did not let me do this. He said “you can not change the HTTP headers on a GET request and you can not change them if your method is POST but you do not send at least one parameter.”

What? What are you doing exactly? This costed my 5 days you idiot?!

If you want to change HTTP headers when requesting a URL, you MUST;

1- Set your method as POST,

2- Add at least one parameter even if you do not need.

(Here I will update with a code snippet.)

Yorum yapın

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Değiştir )

Twitter picture

You are commenting using your Twitter account. Log Out / Değiştir )

Facebook photo

You are commenting using your Facebook account. Log Out / Değiştir )

Connecting to %s

Takip Et

Get every new post delivered to your Inbox.