406 & 400 errors
Posted: Fri Feb 06, 2015 4:30 pm
Hi guys, I'm new here ... bought a few of these ESPs from ebay and I managed to get stuck creating a http request.
If I use postman to create the request it's all good, tried all kinds of combinations, added host
I'm using Software serial for arduino -> esp. Baud rate is 9600
If I use postman to create the request it's all good, tried all kinds of combinations, added host
I'm using Software serial for arduino -> esp. Baud rate is 9600
Code: Select all
wifi.println("AT+CIPSTART=\"TCP\",\"192.168.1.100\",80");
Serial.println("AT+CIPSTART=\"TCP\",\"192.168.1.100\",80");
if(wifi.find("Connected")) {
Serial.println("Connected ...");
}
String data="POST /api/temp \r\n"
"Content-Type: application/x-www-form-urlencoded\r\n"
"&title=sometitle&type=temp&body=20\r\n\r\n";
ready="AT+CIPSEND="; //length
ready+=data.length();
sendData(ready);
Serial.println(data);
wifi.println(data);