AIR HTTPService does not return response headers

Using Mosso Cloud Servers and Cloud Files for few days now I thought it would be useful to have AS3 library that would let me accessing my Cloud Files account directly from AIR. Just after spending last 2 hours writing prototype I came to the point when I wanted to read response headers that Cloud Files REST API returns and it appears to be impossible (Cloud Files returns authentication data using headers). According to what other people say HTTPService has some major limitations.

It got more interesting when I looked at HTTPStatusEvent.responseHeaders and HTTPRequestMessage.recordHeaders properties. Flex is able to determine proxy server headers only and only when using NetworkMonitor. Otherwise responseHeaders is always null.

I can understand why this limitation exists for Flex applications running in the browser. Not all browsers have the ability to access response headers and Adobe wants to keep Flash Player consistent across browsers. But why this wasn’t fixed for AIR where Adobe has full control on where and how Flash Player is running? And why this isn’t left in competence of the developer as HTTPStatusEvent.status is? I have no idea.

This is really disappointing. Does it mean people have to craft there REST for AIR? I hope someone at Adobe is going to have a look at this issue.

One Response to “AIR HTTPService does not return response headers”

  1. Dan Says:

    You could use URLLoader as there is an httpResponseStatus you can listen for which includes a responseHeaders array of URLRequestHeader objects.

    Alternatively, use a third party library like as3httpclientlib at http://code.google.com/p/as3httpclientlib/wiki/Examples

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>