Is there a way to check the HTTP status (possibly the response code) of a download?
I am having an issue (http://developer.anscamobile.com/forum/2011/12/27/error-checking-xml) using an XML parser because I am retrieving an XML file from the Internet. But if the file is not on the server, network.download grabs the 404 page and saves it as the XML file name I specify.
When the XML parser goes to process this, it errors out. And I can't see a way to catch that error and deal with it.
So as someone else suggested, check to see if the XML file is valid in the first place. I thought the easiest way to do this would be to check during the download to see if the XML was not a 404 erorr, and if it is, don't get it.
Is there a way to do that within Corona? I've done this before in JS using AJAX, but not sure how to do this in Corona.
Would appreciate any pointers. (And I am a Corona/LUA newbie, so I apologize if this is something that I should know, though my Google searching didn't bring up any information either.)
Thanks everyone.