到目前为止,我试过这种方式,但没有运气:
var qHeader : URLRequestHeader = new URLRequestHeader();
var urlRequest : URLRequest = new URLRequest( requestTarget.text );
urlRequest.method = URLRequestMethod.POST;
urlRequest.data = cookiesObject;
//urlRequest.requestHeaders.push( qHeader );
urlRequest.requestHeaders = new Array( "Cookie: ASP.NET_SessionId=u43mjnpuerdicmu5pjobi2dz" )
var rr : Response = new Response();
//URLRequestDefaults.manageCookies = true;
var _urlLoader : URLLoader = new URLLoader();
_urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
_urlLoader.addEventListener( Event.COMPLETE, onReceive );
_urlLoader.addEventListener( IOErrorEvent.IO_ERROR, onFail );
_urlLoader.load( urlRequest );
答案 0 :(得分:1)
每个请求标头必须是URLRequestHeader
对象。试试这个:
urlRequest.requestHeaders = new Array(new URLRequestHeader("Cookie", "ASP.NET_SessionId=u43mjnpuerdicmu5pjobi2dz"));