HTTP operations - return some sort of error indication

Hello everyone,

Is there a way for the Imp to tell if an HTTP request (either GET or POST) has failed and what was the error code? What I ended up doing is set a timer via imp.wakeup() and when the callback gets called I check if there has been a response and if there hasn’t, I consider the connection dead and retry. Of course, this doesn’t mean that the original request is not still active (would a new request override a previous one or will they both run in parallel and eventually complete)?

I could design my protocol to prevent double requests but I would prefer having a way of telling if the request ended in failure (error 404 or connection refused or whatever). I’m posting against my own server, so 404 is unlikely, but connection might be refused if the server is down or something is wrong with our hosters.

Razvan

There’s no way to do this right now, but as I’ve said before, the current APIs are placeholders. The real APIs will let you do all this and more.