unable to get HTTP response code/headers in actionscript 3?

后端 未结 3 1437
花落未央
花落未央 2021-01-18 22:45

I\'m using URLLoader to POST to a server. The xml response from the server can respond with a 404 or a 403 (forbidden) error. However I am unable to get the response codes

3条回答
  •  情歌与酒
    2021-01-18 23:24

    For AIR Only you can use the httpResponseStatus. Otherwise in Flash/Flex without AIR you cannot.

    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLLoader.html#event:httpResponseStatus

    httpResponseStatus Event
    Event Object Type: flash.events.HTTPStatusEvent HTTPStatusEvent.type property = flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS

    Language Version : ActionScript 3.0 Runtime Versions : AIR 1.0 AIR 1.0

    Dispatched if a call to the load() method attempts to access data over HTTP, and Adobe AIR is able to detect and return the status code for the request. Unlike the httpStatus event, the httpResponseStatus event is delivered before any response data. Also, the httpResponseStatus event includes values for the responseHeaders and responseURL properties (which are undefined for an httpStatus event. Note that the httpResponseStatus event (if any) will be sent before (and in addition to) any complete or error event.

提交回复
热议问题