@@ -45,6 +45,7 @@ class HttpClient : public Client
4545// FIXME Update tempToPachube example to calculate Content-Length correctly
4646
4747 HttpClient (Client& aClient, const char * aServerName, uint16_t aServerPort = kHttpPort );
48+ HttpClient (Client& aClient, const String& aServerName, uint16_t aServerPort = kHttpPort );
4849 HttpClient (Client& aClient, const IPAddress& aServerAddress, uint16_t aServerPort = kHttpPort );
4950
5051 /* * Start a more complex request.
@@ -66,20 +67,29 @@ class HttpClient : public Client
6667 int get (const char * aURLPath)
6768 { return startRequest (aURLPath, HTTP_METHOD_GET); }
6869
70+ int get (const String& aURLPath)
71+ { return get (aURLPath.c_str ()); }
72+
6973 /* * Connect to the server and start to send a POST request.
7074 @param aURLPath Url to request
7175 @return 0 if successful, else error
7276 */
7377 int post (const char * aURLPath)
7478 { return startRequest (aURLPath, HTTP_METHOD_POST); }
7579
80+ int post (const String& aURLPath)
81+ { return post (aURLPath.c_str ()); }
82+
7683 /* * Connect to the server and start to send a PUT request.
7784 @param aURLPath Url to request
7885 @return 0 if successful, else error
7986 */
8087 int put (const char * aURLPath)
8188 { return startRequest (aURLPath, HTTP_METHOD_PUT); }
8289
90+ int put (const String& aURLPath)
91+ { return put (aURLPath.c_str ()); }
92+
8393 /* * Connect to the server and start to send the request.
8494 @param aURLPath Url to request
8595 @param aHttpMethod Type of HTTP request to make, e.g. "GET", "POST", etc.
0 commit comments