Quantcast
Channel: Adobe Community : Discussion List - Using Flash Builder
Viewing all articles
Browse latest Browse all 1802

URLLoader does not response http 301 status code

$
0
0

Hi,

 

I  develop with Air28 API and use urlloader in the client to send url request to my server, after some processes, the server reports status 301 code to the client and I don't think the events were be delivered properly. My code in the client as below:

 

  publicfunction fetch(url:String, urlRequest:URLRequest = null, dataFormat:String = URLLoaderDataFormat.TEXT, followRedirect:Boolean = true):void {

  trace(LOG+"Fetching " + url);

  _urlRequest = urlRequest;

  if (_urlRequest == null) {

  _urlRequest = new URLRequest();

  setUserAgent();

  _urlRequest.manageCookies = true;

  _urlRequest.method = URLRequestMethod.GET;

  }

  _urlRequest.followRedirects = followRedirect;

  _urlRequest.url = url;

 

  var urlLoader:URLLoader = new URLLoader();

  urlLoader.addEventListener(Event.COMPLETE, handleComplete);

  urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

  urlLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);

  urlLoader.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, httpResponseStatusHandler);

  urlLoader.dataFormat = dataFormat;

  urlLoader.load(_urlRequest);

  }

 

I've tried to response code 20x, 40x from the server, the events dispatching sequence at client side will be HTTP_RESPONSE_STATUS -> HTTP_STATUS -> COMPLETE which are all rights. But when response code 301, httpResponseStatusHandler receive nothing while httpStatusHandler and handleComplete receive status code 0 and null responseUrl. Does anyone experience the same thing?  I think it may be a bug of Air28 api.


Viewing all articles
Browse latest Browse all 1802

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>