arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
audio_tools::HttpRequest Class Reference

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 ()
 
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)
 
size_t getReceivedContentLength ()
 
virtual int head (Url &url, const char *acceptMime=nullptr, const char *data=nullptr, int len=-1)
 
virtual HttpRequestHeaderheader ()
 
bool isReady ()
 returns true when the request has completed and ready for the data to be requested
 
 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 HttpReplyHeaderreply ()
 
virtual void setAcceptMime (const char *mime)
 
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, int32_t timeout)
 
virtual int process (MethodID action, Url &url, const char *mime, const char *data, int len=-1)
 

Protected Attributes

const char * accept = ACCEPT_ALL
 
const char * accept_encoding = nullptr
 
const char * agent = nullptr
 
HttpChunkReader chunk_reader = HttpChunkReader(reply_header)
 
Clientclient_ptr
 
int32_t clientTimeout = URL_CLIENT_TIMEOUT
 
const char * connection = CON_CLOSE
 
const char * host_name =nullptr
 
bool is_ready = false
 
HttpReplyHeader reply_header
 
HttpRequestHeader request_header
 
Url url
 

Friends

class URLStreamDefault
 

Detailed Description

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

The documentation for this class was generated from the following file: