[HTTP] Added GET overload for Arduino String
This commit is contained in:
parent
9d7e9040cf
commit
9e720f56c5
2 changed files with 5 additions and 0 deletions
|
@ -5,6 +5,10 @@ HTTPClient::HTTPClient(TransportLayer* tl, uint16_t port) {
|
||||||
_port = port;
|
_port = port;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int16_t HTTPClient::get(String& url, String& response) {
|
||||||
|
return(HTTPClient::get(url.c_str(), response));
|
||||||
|
}
|
||||||
|
|
||||||
int16_t HTTPClient::get(const char* url, String& response) {
|
int16_t HTTPClient::get(const char* url, String& response) {
|
||||||
// get the host address and endpoint
|
// get the host address and endpoint
|
||||||
char* httpPrefix = strstr(url, "http://");
|
char* httpPrefix = strstr(url, "http://");
|
||||||
|
|
|
@ -10,6 +10,7 @@ class HTTPClient {
|
||||||
HTTPClient(TransportLayer* tl, uint16_t port = 80);
|
HTTPClient(TransportLayer* tl, uint16_t port = 80);
|
||||||
|
|
||||||
// basic methods
|
// basic methods
|
||||||
|
int16_t get(String& url, String& response);
|
||||||
int16_t get(const char* url, String& response);
|
int16_t get(const char* url, String& response);
|
||||||
int16_t post(const char* url, const char* content, String& response, const char* contentType = "text/plain");
|
int16_t post(const char* url, const char* content, String& response, const char* contentType = "text/plain");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue