After a succesful HTTP post operation, i.e. sending data to a server with the AT#HTTPSND command, I usually (as expected) get the response:
#HTTPRING: 0,200,”text/html”,0
Typically, the response comes within one second, sometimes it may take three to five seconds, which is hardly surprising as such. There may be delays in the network or your server may be temporarily oveloaded.
But how long can it take and is there a way to reject a late arriving response, to avoid endless waiting and ruining of your script’s overall performance?
In the AT#HTTPCFG command there is a field called . What exactly does it control and could I set it at a low value, for example at 3, and thereby get an automatic rejection of an AT#HTTPSND command that will not produce a #HTTPRING: response within 3 seconds?
There are some notes regarding the timeout in the description of the #HTTPSND command from which can be understand that your guess is right, after the timeout the ring comes with a 0 parameter; the actual time can be greater than the timeout because it includes the request transmission as well.
Thanks Cosmin, I will add some extra debugging code to report the actual delays between my HTTP post command and the server response. Interesting to see if the delay can exceed the value set in the HTTP config command. Hopefully not.
A very late response would be nasty if you already issued a renewal of the HTTP post command. Hard to tell if the response relates to the first or the second HTTP post command.
We use cookies to enhance your browsing experience and help us improve our websites. To improve our website, we carefully select third parties that use cookies to allow us to serve specific content and achieve the purposes set out in our cookie policy. For more information on how to make adjustments through your browser to the cookies being used on your device, please click Find Out More link. By closing this banner or continuing to browse our website, you agree to our use of such cookies. FIND OUT MORE
After a succesful HTTP post operation, i.e. sending data to a server with the AT#HTTPSND
command, I usually (as expected) get the response:
#HTTPRING: 0,200,”text/html”,0
Typically, the response comes within one second, sometimes it may take three to five
seconds, which is hardly surprising as such. There may be delays in the network or your
server may be temporarily oveloaded.
But how long can it take and is there a way to reject a late arriving response, to avoid
endless waiting and ruining of your script’s overall performance?
In the AT#HTTPCFG command there is a field called . What exactly does it control
and could I set it at a low value, for example at 3, and thereby get an automatic rejection
of an AT#HTTPSND command that will not produce a #HTTPRING: response within 3 seconds?
There are some notes regarding the timeout in the description of the #HTTPSND command from which can be understand that your guess is right, after the timeout the ring comes with a 0 parameter; the actual time can be greater than the timeout because it includes the request transmission as well.
Thanks Cosmin, I will add some extra debugging code to report the actual delays between my HTTP post command and the server response. Interesting to see if the delay can exceed the value set in the HTTP config command. Hopefully not.
A very late response would be nasty if you already issued a renewal of the HTTP post command. Hard to tell if the response relates to the first or the second HTTP post command.