0
  • 如何从 AIR 应用程序打开并保持与特定 Web 服务器的会话?

到目前为止,我尝试过这种方式,但没有运气:

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 );          
4

1 回答 1

1

每个请求标头必须是一个URLRequestHeader对象。尝试这个:

urlRequest.requestHeaders = new Array(new URLRequestHeader("Cookie", "ASP.NET_SessionId=u43mjnpuerdicmu5pjobi2dz"));
于 2012-11-30T11:42:22.117 回答