mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
fix standalone
This commit is contained in:
@@ -156,19 +156,13 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject input) {
|
|||||||
// serialize JSON to string to ensure correct content-length and avoid HTTP parsing errors (issue #2752)
|
// serialize JSON to string to ensure correct content-length and avoid HTTP parsing errors (issue #2752)
|
||||||
std::string output_str;
|
std::string output_str;
|
||||||
serializeJson(output, output_str);
|
serializeJson(output, output_str);
|
||||||
|
|
||||||
request->send(ret_codes[return_code], "application/json; charset=utf-8", output_str.c_str());
|
request->send(ret_codes[return_code], "application/json; charset=utf-8", output_str.c_str());
|
||||||
|
|
||||||
api_count_++;
|
|
||||||
delete response;
|
|
||||||
|
|
||||||
#if defined(EMSESP_UNITY)
|
#if defined(EMSESP_UNITY)
|
||||||
// store the result so we can test with Unity later
|
// store the result so we can test with Unity later
|
||||||
storeResponse(output);
|
storeResponse(output);
|
||||||
#endif
|
#endif
|
||||||
#if defined(EMSESP_STANDALONE) && !defined(EMSESP_UNITY)
|
#if defined(EMSESP_STANDALONE) && !defined(EMSESP_UNITY)
|
||||||
std::string output_str;
|
|
||||||
serializeJson(output, output_str);
|
|
||||||
Serial.printf("%sweb output: %s[%s] %s(%d)%s %s%s",
|
Serial.printf("%sweb output: %s[%s] %s(%d)%s %s%s",
|
||||||
COLOR_WHITE,
|
COLOR_WHITE,
|
||||||
COLOR_BRIGHT_CYAN,
|
COLOR_BRIGHT_CYAN,
|
||||||
@@ -181,6 +175,9 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject input) {
|
|||||||
Serial.println();
|
Serial.println();
|
||||||
EMSESP::logger().debug("web output: %s %s", request->url().c_str(), output_str.c_str());
|
EMSESP::logger().debug("web output: %s %s", request->url().c_str(), output_str.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
api_count_++;
|
||||||
|
delete response;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(EMSESP_UNITY)
|
#if defined(EMSESP_UNITY)
|
||||||
|
|||||||
Reference in New Issue
Block a user