Removed not needed code
This commit is contained in:
parent
4379c1ae28
commit
5381a6b32d
|
@ -56,28 +56,6 @@ void setup() {
|
||||||
request->send(200, "text/plain", "WOW you are weird");
|
request->send(200, "text/plain", "WOW you are weird");
|
||||||
});
|
});
|
||||||
|
|
||||||
// Send a GET request to <IP>/get?message=<message>
|
|
||||||
server.on("/get", HTTP_GET, [] (AsyncWebServerRequest *request) {
|
|
||||||
String message;
|
|
||||||
if (request->hasParam(PARAM_MESSAGE)) {
|
|
||||||
message = request->getParam(PARAM_MESSAGE)->value();
|
|
||||||
} else {
|
|
||||||
message = "No message sent";
|
|
||||||
}
|
|
||||||
request->send(200, "text/plain", "Hello, GET: " + message);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Send a POST request to <IP>/post with a form field message set to <message>
|
|
||||||
server.on("/post", HTTP_POST, [](AsyncWebServerRequest *request){
|
|
||||||
String message;
|
|
||||||
if (request->hasParam(PARAM_MESSAGE, true)) {
|
|
||||||
message = request->getParam(PARAM_MESSAGE, true)->value();
|
|
||||||
} else {
|
|
||||||
message = "No message sent";
|
|
||||||
}
|
|
||||||
request->send(200, "text/plain", "Hello, POST: " + message);
|
|
||||||
});
|
|
||||||
|
|
||||||
server.onNotFound(notFound);
|
server.onNotFound(notFound);
|
||||||
|
|
||||||
server.begin();
|
server.begin();
|
||||||
|
|
|
@ -52,29 +52,6 @@ void setup() {
|
||||||
request->send(200, "text/plain", "Was there ever anything here?");
|
request->send(200, "text/plain", "Was there ever anything here?");
|
||||||
});
|
});
|
||||||
|
|
||||||
// Send a GET request to <IP>/get?message=<message>
|
|
||||||
server.on("/get", HTTP_GET, [] (AsyncWebServerRequest *request) {
|
|
||||||
String message;
|
|
||||||
if (request->hasParam(PARAM_MESSAGE)) {
|
|
||||||
message = request->getParam(PARAM_MESSAGE)->value();
|
|
||||||
} else {
|
|
||||||
message = "No message sent";
|
|
||||||
}
|
|
||||||
request->send(200, "text/plain", "Hello, GET: " + message);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Send a POST request to <IP>/post with a form field message set to <message>
|
|
||||||
server.on("/post", HTTP_POST, [](AsyncWebServerRequest *request){
|
|
||||||
String message;
|
|
||||||
if (request->hasParam(PARAM_MESSAGE, true)) {
|
|
||||||
message = request->getParam(PARAM_MESSAGE, true)->value();
|
|
||||||
} else {
|
|
||||||
message = "No message sent";
|
|
||||||
}
|
|
||||||
request->send(200, "text/plain", "Hello, POST: " + message);
|
|
||||||
});
|
|
||||||
|
|
||||||
server.onNotFound(notFound);
|
|
||||||
|
|
||||||
server.begin();
|
server.begin();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue