#include <HttpClient.h>
|
virtual | ~HttpClient () |
| HttpClient destructor. More...
|
|
bool | sendRequest (const Url &url, RequestCompletedDelegate requestComplete) |
|
bool | sendRequest (const HttpMethod method, const Url &url, const HttpHeaders &headers, RequestCompletedDelegate requestComplete) |
|
bool | sendRequest (const HttpMethod method, const Url &url, const HttpHeaders &headers, const String &body, RequestCompletedDelegate requestComplete) |
|
bool | sendRequest (const HttpMethod method, const Url &url, const HttpHeaders &headers, String &&body, RequestCompletedDelegate requestComplete) noexcept |
|
bool | downloadString (const Url &url, RequestCompletedDelegate requestComplete, size_t maxLength=NETWORK_SEND_BUFFER_SIZE) |
| Queue request to download content as string (in memory) More...
|
|
bool | downloadFile (const Url &url, RequestCompletedDelegate requestComplete=nullptr) |
|
bool | downloadFile (const Url &url, const String &saveFileName, RequestCompletedDelegate requestComplete=nullptr) |
| Queue request to download a file. More...
|
|
bool | send (HttpRequest *request) |
|
HttpRequest * | request (const String &url) |
|
HttpRequest * | createRequest (const Url &url) |
| Helper function to create a new request on a URL. More...
|
|
|
static void | cleanup () |
| Use this method to clean all object pools. More...
|
|
◆ HttpConnectionPool
◆ ~HttpClient()
virtual HttpClient::~HttpClient |
( |
| ) |
|
|
inlinevirtual |
HttpClient destructor.
- Note
- DON'T call cleanup. If you want to free all resources from HttpClients the correct sequence will be to
- Delete all instances of HttpClient
- Call the static method HttpClient::cleanup();
◆ cleanup()
static void HttpClient::cleanup |
( |
| ) |
|
|
inlinestatic |
Use this method to clean all object pools.
◆ createRequest()
Helper function to create a new request on a URL.
- Parameters
-
- Return values
-
◆ downloadFile() [1/2]
◆ downloadFile() [2/2]
Queue request to download a file.
- Parameters
-
url | Source of file data |
saveFileName | Path to save file to. Optional: specify nullptr to use name from url |
requestComplete | Completion callback |
◆ downloadString()
Queue request to download content as string (in memory)
- Parameters
-
url | URL from which the content will be fetched |
requestComplete | Completion callback |
maxLength | maximum bytes to store in memory. If the response is bigger than maxLength then the rest bytes will be discarded. Use this parameter wisely as setting the value too high may consume all available RAM resulting in device restart and Denial-Of-Service |
◆ getCacheKey()
String HttpClient::getCacheKey |
( |
const Url & |
url | ) |
|
|
inlineprotected |
◆ request()
◆ send()
◆ sendRequest() [1/4]
◆ sendRequest() [2/4]
◆ sendRequest() [3/4]
◆ sendRequest() [4/4]
◆ httpConnectionPool
The documentation for this class was generated from the following file: