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

In a http request and reply we need to process header information. With this API we can define and query the header information. The individual header lines are stored in a vector. This is the common functionality for the HttpRequest and HttpReplyHeader subclasses. More...

#include <HttpHeader.h>

Inheritance diagram for audio_tools::HttpHeader:
audio_tools::HttpReplyHeader audio_tools::HttpRequestHeader

Public Member Functions

HttpHeaderclear (bool activeFlag=true)
 clears the data - usually we do not delete but we just set the active flag
 
const char * get (const char *key)
 
bool isChunked ()
 
bool isRedirectStatus ()
 
bool isValidStatus ()
 returns true if status code >=200 and < 300
 
MethodID method ()
 
const char * protocol ()
 
HttpHeaderput (const char *key, const char *value)
 
HttpHeaderput (const char *key, int value)
 adds a new line to the header - e.g. for content size
 
HttpHeaderput (const char *line)
 adds a received new line to the header
 
void read (Client &in)
 reads the full header from the request (stream)
 
void readLine (Client &in, char *str, int len)
 
void setAutoCreateLines (bool is_auto_line)
 automatically create new lines
 
int statusCode ()
 
const char * statusMessage ()
 
const char * urlPath ()
 
void write (Client &out)
 writes the full header to the indicated HttpStreamedMultiOutput stream
 
void writeHeaderLine (Client &out, HttpHeaderLine *header)
 

Protected Member Functions

void crlf (Client &out)
 
MethodID getMethod (const char *line)
 
HttpHeaderLineheaderLine (const char *key)
 
virtual void parse1stLine (const char *line)=0
 
virtual void write1stLine (Client &out)=0
 

Protected Attributes

bool create_new_lines = true
 
const char * CRLF = "\r\n"
 
bool is_chunked = false
 
bool is_written = false
 
Vector< HttpHeaderLine * > lines
 
MethodID method_id
 
StrExt protocol_str = StrExt(10)
 
HttpLineReader reader
 
int status_code = UNDEFINED
 
StrExt status_msg = StrExt(20)
 
StrExt url_path = StrExt(70)
 

Detailed Description

In a http request and reply we need to process header information. With this API we can define and query the header information. The individual header lines are stored in a vector. This is the common functionality for the HttpRequest and HttpReplyHeader subclasses.

Author
Phil Schatzmann

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