@@ -45,6 +45,7 @@ class HttpClient : public Client
45
45
// FIXME Update tempToPachube example to calculate Content-Length correctly
46
46
47
47
HttpClient (Client& aClient, const char * aServerName, uint16_t aServerPort = kHttpPort );
48
+ HttpClient (Client& aClient, const String& aServerName, uint16_t aServerPort = kHttpPort );
48
49
HttpClient (Client& aClient, const IPAddress& aServerAddress, uint16_t aServerPort = kHttpPort );
49
50
50
51
/* * Start a more complex request.
@@ -66,20 +67,29 @@ class HttpClient : public Client
66
67
int get (const char * aURLPath)
67
68
{ return startRequest (aURLPath, HTTP_METHOD_GET); }
68
69
70
+ int get (const String& aURLPath)
71
+ { return get (aURLPath.c_str ()); }
72
+
69
73
/* * Connect to the server and start to send a POST request.
70
74
@param aURLPath Url to request
71
75
@return 0 if successful, else error
72
76
*/
73
77
int post (const char * aURLPath)
74
78
{ return startRequest (aURLPath, HTTP_METHOD_POST); }
75
79
80
+ int post (const String& aURLPath)
81
+ { return post (aURLPath.c_str ()); }
82
+
76
83
/* * Connect to the server and start to send a PUT request.
77
84
@param aURLPath Url to request
78
85
@return 0 if successful, else error
79
86
*/
80
87
int put (const char * aURLPath)
81
88
{ return startRequest (aURLPath, HTTP_METHOD_PUT); }
82
89
90
+ int put (const String& aURLPath)
91
+ { return put (aURLPath.c_str ()); }
92
+
83
93
/* * Connect to the server and start to send the request.
84
94
@param aURLPath Url to request
85
95
@param aHttpMethod Type of HTTP request to make, e.g. "GET", "POST", etc.
0 commit comments