mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-27 21:16:50 +03:00
allow String for payload in HTTPclient sendRequest
This commit is contained in:
parent
bf067f718a
commit
27f1a63170
@ -305,6 +305,16 @@ int HTTPClient::POST(String payload) {
|
|||||||
return POST((uint8_t *) payload.c_str(), payload.length());
|
return POST((uint8_t *) payload.c_str(), payload.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sendRequest
|
||||||
|
* @param type const char * "GET", "POST", ....
|
||||||
|
* @param payload String data for the message body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int HTTPClient::sendRequest(const char * type, String payload) {
|
||||||
|
return sendRequest(type, (uint8_t *) payload.c_str(), payload.length());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sendRequest
|
* sendRequest
|
||||||
* @param type const char * "GET", "POST", ....
|
* @param type const char * "GET", "POST", ....
|
||||||
|
@ -147,6 +147,7 @@ class HTTPClient {
|
|||||||
int GET();
|
int GET();
|
||||||
int POST(uint8_t * payload, size_t size);
|
int POST(uint8_t * payload, size_t size);
|
||||||
int POST(String payload);
|
int POST(String payload);
|
||||||
|
int sendRequest(const char * type, String payload);
|
||||||
int sendRequest(const char * type, uint8_t * payload = NULL, size_t size = 0);
|
int sendRequest(const char * type, uint8_t * payload = NULL, size_t size = 0);
|
||||||
int sendRequest(const char * type, Stream * stream, size_t size = 0);
|
int sendRequest(const char * type, Stream * stream, size_t size = 0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user