mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
use msgpack content-type - #2166
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
#include <Print.h>
|
#include <Print.h>
|
||||||
|
|
||||||
constexpr const char * JSON_MIMETYPE = "application/json";
|
constexpr const char * JSON_MIMETYPE = "application/json";
|
||||||
|
constexpr const char * MSGPACK_MIMETYPE = "application/msgpack";
|
||||||
|
|
||||||
class ChunkPrint : public Print {
|
class ChunkPrint : public Print {
|
||||||
private:
|
private:
|
||||||
@@ -54,7 +55,7 @@ class AsyncJsonResponse : public AsyncAbstractResponse {
|
|||||||
: _isValid{false}
|
: _isValid{false}
|
||||||
, _isMsgPack{isMsgPack} {
|
, _isMsgPack{isMsgPack} {
|
||||||
_code = 200;
|
_code = 200;
|
||||||
_contentType = JSON_MIMETYPE;
|
_contentType = (isMsgPack) ? MSGPACK_MIMETYPE : JSON_MIMETYPE;
|
||||||
if (isArray)
|
if (isArray)
|
||||||
_root = _jsonBuffer.add<JsonArray>();
|
_root = _jsonBuffer.add<JsonArray>();
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user