Hi, I'm trying to make a Get request to a page hosted in a server with nginx
I'm connection to it with AT+CIPSTART="TCP","192.168.1.103",80 and the AT+CIPSEND=<length>
after this I'm sending http://192.168.1.103/?var1=val1&var2=val2
it returns a bad request error (400) I've also tried with GET /?var1=val1&var2=val2 HTTP/1.1 but it doesn't return nothing.
Any idea?
post the code
post the answer to AT+CIPSEND=<length>
I'm working with the Serial monitor has console so i'm manualy inserting each line
AT+CIPSTART="TCP","192.168.178.103",80
CONNECT
OK
AT+CIPSEND=60
OK
>
busy s...
Recv 60 bytes
SEND OK
+IPD,309:HTTP/1.1 400 Bad Request
Server: nginx/1.18.0
Date: Sun, 102CytttC
<id<edn0scrg.edmE
The code behind it's just
#include <SoftwareSerial.h>
SoftwareSerial esp(4, 5);
void setup() {
Serial.begin(115200);
esp.begin(115200);
Serial.println("Remember to to set Both NL & CR in the serial monitor.");
Serial.println("Ready");
Serial.println("");
}
void loop() {
if(esp.available()) {
Serial.write(esp.read());
}
if(Serial.available()) {
esp.write(Serial.read());
}
}
what's this ? you typing 60 bytes ?
(the error 400 indicates a malformed request if I remember correctly)
By the way, http://192.168.1.103/?var1=val1&var2=val2 is only 42 bytes long
The actual URL contains 60 bytes the one with 42 is an example, the real one contains some provate data
OK
maybe you need to send more information to your server for the request to be accepted