Simple API to process get, put, post, del http requests I tried to use Arduino HttpClient, but I did not manage to extract the mime type from streaming get requests.
More...
|
| HttpRequest (Client &client) |
|
void | addRequestHeader (const char *header, const char *value) |
| Adds/Updates a request header.
|
|
virtual int | available () override |
|
virtual int | availableForWrite () override |
|
virtual bool | begin () |
|
Client & | client () |
|
virtual bool | connected () |
|
size_t | contentLength () |
|
virtual int | del (Url &url, const char *mime=nullptr, const char *data=nullptr, int len=-1) |
| http del
|
|
void | end () override |
| same as end()
|
|
virtual void | flush () override |
|
virtual int | get (Url &url, const char *acceptMime=nullptr, const char *data=nullptr, int len=-1) |
| http get
|
|
virtual int | head (Url &url, const char *acceptMime=nullptr, const char *data=nullptr, int len=-1) |
| http head
|
|
virtual HttpRequestHeader & | header () |
| provides access to the request header
|
|
bool | isChunked () |
| we are sending the data chunked
|
|
bool | isReady () |
|
| operator bool () |
|
virtual int | post (Url &url, const char *mime, const char *data, int len=-1) |
| http post
|
|
virtual int | post (Url &url, const char *mime, Stream &data, int len=-1) |
| http post
|
|
virtual int | process (MethodID action, Url &url, const char *mime, const char *data, int lenData=-1) |
|
virtual int | process (MethodID action, Url &url, const char *mime, Stream &stream, int len=-1) |
|
virtual bool | processBegin (MethodID action, Url &url, const char *mime, int lenData=-1) |
| starts http request processing
|
|
virtual int | processEnd () |
| Ends the http request processing and returns the status code.
|
|
virtual void | processWrite (Stream &stream) |
| Writes (Posts) the data of the indicated stream after calling processBegin.
|
|
virtual int | put (Url &url, const char *mime, const char *data, int len=-1) |
| http put
|
|
virtual int | put (Url &url, const char *mime, Stream &data, int len=-1) |
| http put
|
|
virtual int | read (uint8_t *str, int len) |
|
size_t | readBytes (uint8_t *str, size_t len) override |
|
size_t | readBytesUntil (char terminator, char *buffer, size_t length) |
|
virtual int | readln (uint8_t *str, int len, bool incl_nl=true) |
|
virtual HttpReplyHeader & | reply () |
|
virtual void | setAcceptMime (const char *mime) |
|
virtual void | setAcceptsEncoding (const char *enc) |
|
virtual void | setAgent (const char *agent) |
| Defines the agent.
|
|
void | setClient (Client &client) |
|
virtual void | setConnection (const char *connection) |
|
void | setHost (const char *host) |
|
void | setOnConnectCallback (void(*callback)(HttpRequest &request, Url &url, HttpRequestHeader &request_header)) |
| Callback which allows you to add additional paramters dynamically.
|
|
void | setTimeout (int timeoutMs) |
| Defines the client timeout in ms.
|
|
virtual void | stop () |
|
size_t | write (const uint8_t *data, size_t len) override |
|
virtual size_t | write (uint8_t ch) override |
|
Simple API to process get, put, post, del http requests I tried to use Arduino HttpClient, but I did not manage to extract the mime type from streaming get requests.
The functionality is based on the Arduino Client class.
- Author
- Phil Schatzmann
- Copyright
- GPLv3