I have a microcontroller I want to connect it to an application and send requests from the application. I found that it is possible to use http, but http needs the microcontroller and the application to be connected to the same network. This will not work in my project because they will not be connected to the same network at all.
Is there another solution or another way that works in this case?
Please I need the solution quickly.
WiFiClient client = server.available();
if (client) {
Serial.println("New client");
String request = "";
while (client.connected()) {
if (client.available()) {
char c = client.read();
request += c;
if (c == '\n') {
if (request.indexOf("GET /") != -1 && request.indexOf("track") != -1) {
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.println("<html><head><title>WiFi Server</title></head><body><h1>Tracking Request Received!</h1></body></html>");
}
break;
}
}
}
delay(1);
client.stop();
Serial.println("Client disconnected");
}