Hello,
I try make code, where I will send data from client to server.
But I send only " " etc.
server code
rpm = server.arg("data");
server.send(303);
server.sendHeader("Location","/");
Serial.println(rpm);
client
String data = rpm;
WiFiClient client;
const int httpPort = 80;
//while (!client.connect(serverHost, httpPort)) {
//Serial.println("connection failed");
//}
client.println("POST / HTTP/1.1");
client.println("Host: http://192.168.1.81/rpm");
client.println("Accept: */*");
client.println("Content-Type: application/x-www-form-urlencoded");
client.print("Content-Length: ");
client.println(data.length());
client.println();
client.print(data);
if (client.connected()) {
client.stop(); // DISCONNECT FROM THE SERVER
}
Anyone have idea?
Best regards