ArduinoHttpClient icon indicating copy to clipboard operation
ArduinoHttpClient copied to clipboard

compatibility issue with TinyGSM

Open mcr-ksh opened this issue 8 years ago • 2 comments

When using TinyGSM, the request is seen on the server side but the client side will receive a timeout when using httpclient->responseStatusCode().

After a lot of debugging I found that the issue might be due to the way the library slowly transmits the request:

CONNECT OK

OK
AT+CIPSEND=1,4

>POST
OK
AT+CIPSEND=1,1

> 
OK
AT+CIPSEND=1,7

>/test/
OK
AT+CIPSEND=1,9

> HTTP/1.1
OK
AT+CIPSEND=1,2

>

OK
AT+CIPSEND=1,10

>Connection
OK
AT+CIPSEND=1,2

>: 
OK
AT+CIPSEND=1,5

>close
OK
AT+CIPSEND=1,2

>

OK
AT+CIPSEND=1,4

>Host
OK
AT+CIPSEND=1,2

>: 
OK
AT+CIPSEND=1,20

Finally the timeout is occurring when calling httpclient->endRequest() does not seem to send "\r\n\r\n".

If I add:

httpclient->write((const byte*)"\r\n", 2);

the server reply is received.

mcr-ksh avatar Jul 17 '17 23:07 mcr-ksh

@mcr-ksh did you ever find a fix for this?

shanedoolane avatar Jan 08 '24 03:01 shanedoolane

cant remember. it's been too long. afaik the code that I provided before did send an additional termination request: httpclient->write((const byte*)"\r\n", 2);

mcr-ksh avatar Jan 08 '24 13:01 mcr-ksh