Return to Snippet

Revision: 53215
at November 16, 2011 13:07 by sidneydekoning


Initial Code
var url:String = _baseURL + "/utils.php";

var headers:Array = [
    new URLRequestHeader("_sessionKey", _sessionKey),
    new URLRequestHeader("_userId", _sessionUserId)
];

var request:URLRequest = new URLRequest();
request.requestHeaders = headers;
request.method = URLRequestMethod.POST;
request.url = url;

/////////////////// 

var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT; //don't know if this is really needed 
loader.addEventListener(Event.COMPLETE, handleSuccess);
loader.addEventListener(IOErrorEvent.IO_ERROR, handleError);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleError);

loader.load(request);

Initial URL

                                

Initial Description

                                

Initial Title
Custom response headers URLRequest AS3

Initial Tags
api

Initial Language
ActionScript 3