mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +03:00
scheduler async, command use string, lowercase
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user