# How to get response headers when POSTing with AS3/Flash 9?

**URL:** <https://forum.kirupa.com/t/how-to-get-response-headers-when-posting-with-as3-flash-9/224507>\
**Category:** Uncategorized\
**Created:** [May 2, 2007, 10:06pm UTC](https://forum.kirupa.com/t/how-to-get-response-headers-when-posting-with-as3-flash-9/224507 "2007-05-02T22:06:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vapidmofo](https://avatars.discourse-cdn.com/v4/letter/v/65b543/32.png) [@vapidmofo](https://forum.kirupa.com/u/vapidmofo)\
**Post date:** [May 2, 2007, 10:06pm UTC](https://forum.kirupa.com/t/how-to-get-response-headers-when-posting-with-as3-flash-9/224507/1 "2007-05-02T22:06:06Z")

</div>

I’m writing some code that POSTs to a REST service. The service returns a 201 status response as well as some information in the response headers, such as:

HTTP/1.x 201 Created  
Server: Apache-Coyote/1.1  
XYZ-Userid: 22  
Content-Length: 0  
Date: Wed, 02 May 2007 16:58:55 GMT

How do i extract that “XYZ-Userid” header?

I noticed that the Apollo version of HTTPStatusEvent returns an array of responseHeaders:  
[http://livedocs.adobe.com/apollo/1.0/aslr/flash/events/HTTPStatusEvent.html](http://livedocs.adobe.com/apollo/1.0/aslr/flash/events/HTTPStatusEvent.html)

but that the Flash/AS3 version does not!  
[http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/index.html](http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/index.html)

Is there a way for me to use the Apollo version of HttpStatusEvent in Flash CS3?

example code:

```
        _loader = new URLLoader();
        _loader.addEventListener(Event.COMPLETE, completeHandler);
        _loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);    
        
        var variables:URLVariables = new URLVariables();
        variables.login = "abc";
        
        var request:URLRequest = new URLRequest(_url);
        request.contentType = 'application/x-www-form-urlencoded';
        request.method = URLRequestMethod.POST;
        request.data = variables;
        _loader.load(request);

    private function httpStatusHandler(event:HTTPStatusEvent):void {
        trace("httpStatusHandler: " + event);
        trace("status: " + event.status);
    }
```
