Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
|
Public Member Functions | |
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 | downloadString (const Url &url, RequestCompletedDelegate requestComplete) |
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) SMING_DEPRECATED |
HttpRequest * | createRequest (const Url &url) |
Helper function to create a new request on a URL. More... | |
Static Public Member Functions | |
static void | cleanup () |
Protected Types | |
typedef ObjectMap< String, HttpClientConnection > | HttpConnectionPool |
Protected Member Functions | |
String | getCacheKey (const Url &url) |
Static Protected Attributes | |
static HttpConnectionPool | httpConnectionPool |
|
inlinevirtual |
HttpClient destructor.
|
inlinestatic |
Use this method to clean all request queues and object pools
|
inline |
Helper function to create a new request on a URL.
url |
HttpRequest* |
bool HttpClient::downloadFile | ( | const Url & | url, |
const String & | saveFileName, | ||
RequestCompletedDelegate | requestComplete = nullptr |
||
) |
Queue request to download a file.
url | Source of file data |
saveFilename | Path to save file to. Optional: specify nullptr to use name from url |
requestComplete | Completion callback |
|
inline |
createRequest()
instead