How do I determine if the HttpService instance timed out? Thanks!
1
votes
3 Answers
3
votes
Be aware of this charming limitation of HTTPService ...
If you set the http.requestTimeout method, it will silently ignore the fact you asked it to be a POST request and discards any and all headers.
For some reason, in Flex, GET dumps all headers.
var http:HTTPService = new HTTPService()
http = new HTTPService();
http.method = "POST";
http.addEventListener(ResultEvent.RESULT, result*emphasized text*Handler);
http.addEventListener(FaultEvent.FAULT, resultHandler);
http.url = "http://www.example.com/post;
//http.requestTimeout = 5; //Watch out for this, there go the headers...
http.method = "POST";
http.send();
Oh yes, setting method = "POST" twice was intentional, what's even funnier is, if you run it in the debugger, when it comes to the last line, http.send(), and you look at the object's internal state, it's still set to be a POST request...
Muppets.
2
votes