Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
|
Public Member Functions | |
HttpRequest (const Url &uri) | |
HttpRequest (const HttpRequest &value) | |
Copy constructor. More... | |
HttpRequest * | clone () const |
Clone this request into a new object using the copy constructor. More... | |
HttpRequest & | operator= (const HttpRequest &rhs) SMING_DEPRECATED |
HttpRequest * | setURL (const Url &uri) |
HttpRequest * | setMethod (HttpMethod method) |
HttpRequest * | setHeaders (const HttpHeaders &headers) |
HttpRequest * | setHeader (const String &name, const String &value) |
HttpRequest * | setPostParameters (const HttpParams ¶ms) SMING_DEPRECATED |
HttpRequest * | setPostParameter (const String &name, const String &value) |
HttpRequest * | setFile (const String &formElementName, IDataSourceStream *stream) |
Sets a file to be sent. More... | |
HttpRequest * | setAuth (AuthAdapter *adapter) |
const String & | getHeader (const String &name) |
const String & | getPostParameter (const String &name) |
String | getPath () SMING_DEPRECATED |
String | getQueryParameter (const String ¶meterName, const String &defaultValue=nullptr) const |
String | getBody () |
Returns content from the body stream as string. More... | |
IDataSourceStream * | getBodyStream () |
Return the current body stream and pass ownership to the caller. More... | |
HttpRequest * | setBody (const String &body) |
HttpRequest * | setBody (IDataSourceStream *stream) |
HttpRequest * | setBody (const uint8_t *rawData, size_t length) |
HttpRequest * | setResponseStream (ReadWriteStream *stream) |
Instead of storing the response body we can set a stream that will take care to process it. More... | |
ReadWriteStream * | getResponseStream () |
Get the response stream (if any) More... | |
HttpRequest * | onHeadersComplete (RequestHeadersCompletedDelegate delegateFunction) |
HttpRequest * | onBody (RequestBodyDelegate delegateFunction) |
HttpRequest * | onRequestComplete (RequestCompletedDelegate delegateFunction) |
void | reset () |
Clear buffers and reset to default state in preparation for another request. More... | |
HttpRequest * | setSslOptions (uint32_t sslOptions) |
uint32_t | getSslOptions () |
HttpRequest * | pinCertificate (SslFingerprints &fingerprints) |
Requires(pins) the remote SSL certificate to match certain fingerprints Check if SHA256 hash of Subject Public Key Info matches the one given. More... | |
HttpRequest * | setSslKeyCert (const SslKeyCertPair &keyCertPair) |
Sets client private key, certificate and password from memory. More... | |
String | toString () |
Tries to present a readable version of the current request values. More... | |
Public Attributes | |
Url | uri |
HttpMethod | method = HTTP_GET |
HttpHeaders | headers |
HttpParams | postParams |
int | retries = 0 |
void * | args = nullptr |
Protected Attributes | |
RequestHeadersCompletedDelegate | headersCompletedDelegate |
RequestBodyDelegate | requestBodyDelegate |
RequestCompletedDelegate | requestCompletedDelegate |
IDataSourceStream * | bodyStream = nullptr |
ReadWriteStream * | responseStream = nullptr |
User-requested stream to store response. More... | |
AuthAdapter * | auth = nullptr |
uint32_t | sslOptions = 0 |
SslFingerprints | sslFingerprints |
SslKeyCertPair | sslKeyCertPair |
Friends | |
class | HttpClientConnection |
class | HttpServerConnection |
HttpRequest::HttpRequest | ( | const HttpRequest & | value | ) |
Copy constructor.
|
inline |
Clone this request into a new object using the copy constructor.
HttpRequest* | The new request object |
String HttpRequest::getBody | ( | ) |
IDataSourceStream* HttpRequest::getBodyStream | ( | ) |
Return the current body stream and pass ownership to the caller.
IDataSourceStream* |
|
inline |
uri.Path
instead
|
inline |
Get the response stream (if any)
|
inline |
clone()
instead
|
inline |
Requires(pins) the remote SSL certificate to match certain fingerprints Check if SHA256 hash of Subject Public Key Info matches the one given.
fingerprints | - passes the certificate fingerprints by reference. |
bool | true of success, false or failure |
void HttpRequest::reset | ( | ) |
Clear buffers and reset to default state in preparation for another request.
|
inline |
Sets a file to be sent.
const | String& formElementName the name of the element in the form |
IDataSourceStream* | stream - pointer to the stream (doesn't have to be a FileStream) |
HttpRequest* |
|
inline |
request.postParams = params
HttpRequest* HttpRequest::setResponseStream | ( | ReadWriteStream * | stream | ) |
Instead of storing the response body we can set a stream that will take care to process it.
stream |
HttpRequest* |
|
inline |
Sets client private key, certificate and password from memory.
SSLKeyCertPair | |
bool | freeAfterHandshake |
HttpRequest | pointer |
String HttpRequest::toString | ( | ) |
Tries to present a readable version of the current request values.
String |
|
protected |
User-requested stream to store response.