[HTTP] Added GET overload for Arduino String

pull/13/head
jgromes 2019-02-23 09:37:22 +01:00
rodzic 9d7e9040cf
commit 9e720f56c5
2 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -5,6 +5,10 @@ HTTPClient::HTTPClient(TransportLayer* tl, uint16_t 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) {
// get the host address and endpoint
char* httpPrefix = strstr(url, "http://");

Wyświetl plik

@ -10,6 +10,7 @@ class HTTPClient {
HTTPClient(TransportLayer* tl, uint16_t port = 80);
// basic methods
int16_t get(String& 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");