scheduler async, command use string, lowercase

This commit is contained in:
MichaelDvP
2024-07-20 18:21:26 +02:00
parent d35dd1a9c4
commit c21c0b5dd1
9 changed files with 95 additions and 98 deletions

View File

@@ -622,18 +622,13 @@ std::string compute(const std::string & expr) {
String method = doc["method"] | "GET"; // default GET
// if there is data, force a POST
if (value.length()) {
if (value.length() || method == "post") {
if (value.startsWith("{")) {
http.addHeader("Content-Type", "application/json"); // auto-set to JSON
}
httpResult = http.POST(value);
} else {
// no value, but check if it still a POST request
if (method == "POST") {
httpResult = http.POST(value);
} else {
httpResult = http.GET(); // normal GET
}
httpResult = http.GET(); // normal GET
}
http.end();