Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions rest_client.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
******************************************************************************
* @file rest_client.cpp
*
*
* details: https://github.com/llad/spark-restclient
*
*
* credit: https://github.com/csquared/arduino-restclient
*
*
******************************************************************************

*/
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 5 additions & 3 deletions rest_client.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
******************************************************************************
* @file rest_client.h
*
*
* details: https://github.com/llad/spark-restclient
*
*
* credit: https://github.com/csquared/arduino-restclient
*
*
******************************************************************************

*/
Expand All @@ -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
Expand Down