I recently discovered something interesting trying to implement a REST API call in an AIR application.
When you load a URL request in Flex, you usually listen for complete, I/O error and security error events on the loader. However, I’ve learned that it’s important to also listen for HTTP response status events when loading a URL request in AIR.
Otherwise you might not receive a response when the result is anything other than success (200). Instead, you’ll receive an I/O error: “Error #2032: Stream Error.”
Consider the following sample code:
No action is required in the onHTTPStatus() method above. As long as you are listening for the event, you will always receive a response.