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...
#include <HttpRequest.h>
Public Member Functions | |
HttpRequest (Client &client) | |
virtual int | available () |
Client * | client () |
virtual bool | connected () |
virtual int | del (Url &url, const char *mime=nullptr, const char *data=nullptr, int len=-1) |
virtual int | get (Url &url, const char *acceptMime=nullptr, const char *data=nullptr, int len=-1) |
virtual int | head (Url &url, const char *acceptMime=nullptr, const char *data=nullptr, int len=-1) |
operator bool () | |
virtual int | post (Url &url, const char *mime, const char *data, int len=-1) |
virtual int | put (Url &url, const char *mime, const char *data, int len=-1) |
virtual int | read (uint8_t *str, int len) |
virtual int | readln (uint8_t *str, int len, bool incl_nl=true) |
virtual HttpReplyHeader & | reply () |
virtual void | setAcceptsEncoding (const char *enc) |
virtual void | setAgent (const char *agent) |
void | setClient (Client &client) |
virtual void | setConnection (const char *connection) |
void | setHost (const char *host) |
virtual void | stop () |
Protected Member Functions | |
virtual int | connect (const char *ip, uint16_t port) |
virtual int | process (TinyMethodID action, Url &url, const char *mime, const char *data, int len=-1) |
const char * | str (const char *in) |
Protected Attributes | |
const char * | accept = ACCEPT_ALL |
const char * | accept_encoding = nullptr |
const char * | agent = nullptr |
HttpChunkReader | chunk_reader {reply_header} |
Client * | client_ptr |
const char * | connection = CON_CLOSE |
WiFiClientSecure | default_client |
const char * | host_name =nullptr |
HttpReplyHeader | reply_header |
HttpRequestHeader | request_header |
Url | url |
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.