Post topics, source code that relate to the Arduino Platform

User avatar
By ohra
#10830
juke wrote:In the code example.ino there's wifi.sendHttpRequest("example.com", 80, "GET", "/subdir/index.html", "data sended with request", "url_query_data"); I have tried to form the parameters but the server always replays with page 400 - Bad Request and I have no clue to fix this.


If you look at the source code the library actually has a pretty funny way of handling the query parameters. The string you put into the last send parameter is appended into the URL in one query parameter "q". So it ends up being something like
Code: Select allhttp://eaxmple.com/subdir/index.html?q=url_query_data
.

So unless you change things a bit in the library itself you can probably just put a parameter like "xyz?id=01&val=12.4" as the server will then just ignore the extra "q=xyz" parameter.
User avatar
By MelBo
#32955 Hi,

Your library is exactly what I was looking for! Amazing!
I tried to compile your example.. got this error:
performance-test.ino:1:28: fatal error: SoftwareSerial.h: No such file or directory
compilation terminated.
Error compiling.


I am using an adafruit hUZZAH ESP8266 and Arduino 1.6.5

Any idea?

Thanks a lot!
User avatar
By Zweben
#34071 An update: I tried changing the sendHTTPrequest values in case the example.org values were not a working example. I tried the following:

Code: Select allwifi.sendHttpRequest("www.httpbin.org", 80, "GET", "/get", "mirror me", "");


HTTPbin is supposed to mirror the HTTP request, so this should be valid. I now get the following:

Code: Select all GET /get?q= HTTP/1.1Host: www.httpbin.orgConnection: keep-aliveUser-Agent: ESP8266_HTTP_ClientContent-Length: 9mirror me
ESP8266 data sending timeout
AT+CIPCLOSEbusy s...

SEND OK

ESP8266 socket connection closing  timeout
595B
 GET /get?q= HTTP/1.1Host: www.httpbin.orgConnection: keep-aliveUser-Agent: ESP8266_HTTP_ClientContent-Length: 9mirror me
ESP8266 data sending timeout
 GET /get?q= HTTP/1.1Host: www.httpbin.orgConnection: keep-aliveUser-Agent: ESP8266_HTTP_ClientContent-Length: 9mirror me
ESP8266 data sending timeout
AT+CIPCLOSEbusy s...

SEND OK


It tries several times, and gets a 'data sending timeout' 2/3 of the time, and a 'AT+CIPCLOSEbusy s...' + 'SEND OK' + 'socket connection closing timeout' 1/3 of the time.

Does anyone know what might be going on?