diff --git a/RestClient.cpp b/RestClient.cpp index cc5dbd4..5b20c49 100644 --- a/RestClient.cpp +++ b/RestClient.cpp @@ -14,7 +14,9 @@ RestClient::RestClient(const char* _host){ ssl = 0; fingerprint = NULL; num_headers = 0; - contentType = "application/x-www-form-urlencoded"; // default + if (contentType != NULL) { + contentType = "application/x-www-form-urlencoded"; // default + } } RestClient::RestClient(const char* _host, int _port){ @@ -23,7 +25,9 @@ RestClient::RestClient(const char* _host, int _port){ ssl = 0; fingerprint = NULL; num_headers = 0; - contentType = "application/x-www-form-urlencoded"; // default + if (contentType != NULL) { + contentType = "application/x-www-form-urlencoded"; // default + } } bool RestClient::dhcp(){ @@ -44,7 +48,9 @@ RestClient::RestClient(const char* _host, int _port, const char* _fingerprint){ ssl = 1; fingerprint = _fingerprint; num_headers = 0; - contentType = "x-www-form-urlencoded"; // default + if (contentType != NULL) { + contentType = "application/x-www-form-urlencoded"; // default + } } RestClient::RestClient(const char* _host, int _port, int _ssl) { @@ -53,7 +59,9 @@ RestClient::RestClient(const char* _host, int _port, int _ssl) { ssl = (_ssl) ? 1 : 0; fingerprint = NULL; num_headers = 0; - contentType = "x-www-form-urlencoded"; // default + if (contentType != NULL) { + contentType = "application/x-www-form-urlencoded"; // default + } } // GET path @@ -178,7 +186,7 @@ int RestClient::request(const char* method, const char* path, for(int i=0; i