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
but that the Flash/AS3 version does not!
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);
}