diff --git a/rest_client.cpp b/rest_client.cpp index 55ff17d..709730e 100644 --- a/rest_client.cpp +++ b/rest_client.cpp @@ -1,11 +1,11 @@ /** ****************************************************************************** * @file rest_client.cpp - * + * * details: https://github.com/llad/spark-restclient - * + * * credit: https://github.com/csquared/arduino-restclient - * + * ****************************************************************************** */ @@ -34,6 +34,11 @@ RestClient::RestClient(const char* _host, int _port){ contentTypeSet = false; } +// Enable/Disable Content-Type overwrite +void RestClient::setContentTypeOverwrite(bool val) { + contentTypeSet = !val; +} + // GET path int RestClient::get(const char* path){ return request("GET", path, NULL, NULL); diff --git a/rest_client.h b/rest_client.h index 2f6b9c7..2c68d66 100644 --- a/rest_client.h +++ b/rest_client.h @@ -1,11 +1,11 @@ /** ****************************************************************************** * @file rest_client.h - * + * * details: https://github.com/llad/spark-restclient - * + * * credit: https://github.com/csquared/arduino-restclient - * + * ****************************************************************************** */ @@ -28,6 +28,8 @@ class RestClient { const char* body, String* response); // Set a Request Header void setHeader(const char*); + // Enable/Disable Content-Type overwrite + void setContentTypeOverwrite(bool); // GET path int get(const char*); // GET path and response