From 33804d4534dbd4b04ba589849525f8aaa027a2e7 Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Fri, 17 Jun 2016 12:55:17 -0400 Subject: [PATCH] Add support for String parameters to sendHeader and sendHeader --- HttpClient.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/HttpClient.h b/HttpClient.h index e8312f8..ce6a761 100644 --- a/HttpClient.h +++ b/HttpClient.h @@ -105,6 +105,9 @@ public: */ void sendHeader(const char* aHeader); + void sendHeader(const String& aHeader) + { sendHeader(aHeader.c_str()); } + /** Send an additional header line. This is an alternate form of sendHeader() which takes the header name and content as separate strings. The call will add the ": " to separate the header, so for example, to @@ -114,6 +117,9 @@ public: */ void sendHeader(const char* aHeaderName, const char* aHeaderValue); + void sendHeader(const String& aHeaderName, const String& aHeaderValue) + { sendHeader(aHeaderName.c_str(), aHeaderValue.c_str()); } + /** Send an additional header line. This is an alternate form of sendHeader() which takes the header name and content separately but where the value is provided as an integer. @@ -124,6 +130,9 @@ public: */ void sendHeader(const char* aHeaderName, const int aHeaderValue); + void sendHeader(const String& aHeaderName, const int aHeaderValue) + { sendHeader(aHeaderName.c_str(), aHeaderValue); } + /** Send a basic authentication header. This will encode the given username and password, and send them in suitable header line for doing Basic Authentication. @@ -132,6 +141,9 @@ public: */ void sendBasicAuth(const char* aUser, const char* aPassword); + void sendBasicAuth(const String& aUser, const String& aPassword) + { sendBasicAuth(aUser.c_str(), aPassword.c_str()); } + /** Finish sending the HTTP request. This basically just sends the blank line to signify the end of the request */