14 March 2008

Caution with HTTP 201/20x Responses and Custom Request Headers (Flash Player 9)

Written by Richard Leggett ( Contact the author of this post )
Published on March 14th, 2008 @ 06:41:23 pm, using 227 words, 582 views
Categories: Flash, Serverside

Ran into a couple of issues today with Flash Player 9. I’m communicating with a server which uses REST-based services and is very “standards compliant". So when PUTting* to the server, it was responding with a HTTP 201 code (that’s a “created” response) and a 204 status code for a DELETE*. The Flash IDE was choking on this and generating an IOError, unable to read the stream. (*as a sidenote Flash Player doesn’t support the PUT or DELETE verbs right now, so we were using POST instead, and using a request header ("X-HttpVerbOverride") to specify the correct verb.)

The IOError is of course pretty fatal, but I wondered whether it was just the Flash Player in my CS3 IDE which is not the most up to date (I still can’t install the 9.0.2 CS3 IDE update for some reason). So I tried everything in the browser and all seems well. So right now that’s good enough for me, if anyone can confirm this is fixed in 9.0.115 or later that would be great.

The other issue was with the X-HttpVerbOverride custom request header I was adding to overcome the lack of support for PUT and DELETE. It wasn’t being sent (using Charles to check). This one is easy to fix… just make sure you are sending some data in the request and that the request is a POST and all’s well again.

Comments, Pingbacks:

Comment from: Greg
I had a couple of similar issues with FlashPlayer but nothing beat Flash Player when it comes to performance so i continue to use it.
PermalinkPermalink 17/03/08 @ 00:24
Comment from: Ismail Shihadi
What do you mean by thats a "created" response ??
PermalinkPermalink 01/05/08 @ 13:51
Comment from: Richard Leggett [Member] Email
A "Created" response is a HTTP 201:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
PermalinkPermalink 01/05/08 @ 13:59

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))

About

Richard Leggett is a Freelance RIA and Web Developer (download CV, skills/portfolio coming soon). He is co-author of Foundation Flash Applications for Mobile Devices (Friend of ED), an Adobe Community Expert and speaker at industry conferences and user groups.



July 2008
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Categories

Miscellany

XML Feeds

Information

Contact the admin  /   b2evo template by Two18 Media