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

Reading and Writing of Http Replys. More...

#include <HttpHeader.h>

Inheritance diagram for HttpReplyHeader:
HttpHeader

Public Member Functions

HttpHeaderclear ()
 clears the data
 
void end ()
 release static temp buffer
 
const charget (const char *key)
 
List< HttpHeaderLine * > & getHeaderLines ()
 Provides the http parameter lines.
 
bool isChunked ()
 
bool isRedirectStatus ()
 returns true if the status code is >=300 and < 400
 
bool isValidStatus ()
 returns true if status code >=200 and < 300
 
MethodID method ()
 
void parse1stLine (const char *line)
 
const charprotocol ()
 Provide the 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
 
bool read (Client &in)
 reads the full header from the request (stream)
 
void readExt (Client &in)
 
int readLine (Client &in, char *str, int len)
 
void resize (int bufferSize)
 Resizes the internal read buffer.
 
void setAutoCreateLines (bool is_auto_line)
 automatically create new lines
 
void setProcessed ()
 
void setProtocol (const char *protocal)
 Defines the protocol: e.g. HTTP/1.1.
 
void setTimeout (int timeoutMs)
 Set the timout.
 
void setValues (int statusCode, const char *msg="", const char *protocol=nullptr)
 
int statusCode ()
 
const charstatusMessage ()
 
const charurlPath ()
 
void write (Client &out)
 writes the full header to the indicated HttpStreamedMultiOutput stream
 
void write1stLine (Client &out)
 
void writeHeaderLine (Client &out, HttpHeaderLine &header)
 

Protected Member Functions

void crlf (Client &out)
 
MethodID getMethod (const char *line)
 
HttpHeaderLineheaderLine (const char *key)
 
chartempBuffer ()
 

Protected Attributes

bool create_new_lines = true
 
const charCRLF = "\r\n"
 
bool is_chunked = false
 
bool is_written = false
 
List< HttpHeaderLine * > lines
 
MethodID method_id
 
Str protocol_str {10}
 
HttpLineReader reader
 
int status_code = UNDEFINED
 
Str status_msg {20}
 
Vector< chartemp_buffer {HTTP_MAX_LEN}
 
int timeout_ms = URL_CLIENT_TIMEOUT
 
Str url_path {70}
 

Detailed Description

Reading and Writing of Http Replys.

Author
Phil Schatzmann

Member Function Documentation

◆ clear()

HttpHeader & clear ( )
inlineinherited

clears the data

◆ crlf()

void crlf ( Client out)
inlineprotectedinherited

◆ end()

void end ( )
inlineinherited

release static temp buffer

◆ get()

const char * get ( const char key)
inlineinherited

◆ getHeaderLines()

List< HttpHeaderLine * > & getHeaderLines ( )
inlineinherited

Provides the http parameter lines.

◆ getMethod()

MethodID getMethod ( const char line)
inlineprotectedinherited

◆ headerLine()

HttpHeaderLine * headerLine ( const char key)
inlineprotectedinherited

◆ isChunked()

bool isChunked ( )
inlineinherited

◆ isRedirectStatus()

bool isRedirectStatus ( )
inlineinherited

returns true if the status code is >=300 and < 400

◆ isValidStatus()

bool isValidStatus ( )
inlineinherited

returns true if status code >=200 and < 300

◆ method()

MethodID method ( )
inlineinherited

◆ parse1stLine()

void parse1stLine ( const char line)
inlinevirtual

Implements HttpHeader.

◆ protocol()

const char * protocol ( )
inlineinherited

Provide the protocol.

◆ put() [1/3]

HttpHeader & put ( const char key,
const char value 
)
inlineinherited

◆ put() [2/3]

HttpHeader & put ( const char key,
int  value 
)
inlineinherited

adds a new line to the header - e.g. for content size

◆ put() [3/3]

HttpHeader & put ( const char line)
inlineinherited

adds a received new line to the header

◆ read()

bool read ( Client in)
inlineinherited

reads the full header from the request (stream)

◆ readExt()

void readExt ( Client in)
inline

◆ readLine()

int readLine ( Client in,
char str,
int  len 
)
inlineinherited

◆ resize()

void resize ( int  bufferSize)
inlineinherited

Resizes the internal read buffer.

◆ setAutoCreateLines()

void setAutoCreateLines ( bool  is_auto_line)
inlineinherited

automatically create new lines

◆ setProcessed()

void setProcessed ( )
inlineinherited

◆ setProtocol()

void setProtocol ( const char protocal)
inlineinherited

Defines the protocol: e.g. HTTP/1.1.

◆ setTimeout()

void setTimeout ( int  timeoutMs)
inlineinherited

Set the timout.

◆ setValues()

void setValues ( int  statusCode,
const char msg = "",
const char protocol = nullptr 
)
inline

◆ statusCode()

int statusCode ( )
inlineinherited

◆ statusMessage()

const char * statusMessage ( )
inlineinherited

◆ tempBuffer()

char * tempBuffer ( )
inlineprotectedinherited

◆ urlPath()

const char * urlPath ( )
inlineinherited

◆ write()

void write ( Client out)
inlineinherited

writes the full header to the indicated HttpStreamedMultiOutput stream

◆ write1stLine()

void write1stLine ( Client out)
inlinevirtual

Implements HttpHeader.

◆ writeHeaderLine()

void writeHeaderLine ( Client out,
HttpHeaderLine header 
)
inlineinherited

Member Data Documentation

◆ create_new_lines

bool create_new_lines = true
protectedinherited

◆ CRLF

const char* CRLF = "\r\n"
protectedinherited

◆ is_chunked

bool is_chunked = false
protectedinherited

◆ is_written

bool is_written = false
protectedinherited

◆ lines

List<HttpHeaderLine*> lines
protectedinherited

◆ method_id

MethodID method_id
protectedinherited

◆ protocol_str

Str protocol_str {10}
protectedinherited

◆ reader

HttpLineReader reader
protectedinherited

◆ status_code

int status_code = UNDEFINED
protectedinherited

◆ status_msg

Str status_msg {20}
protectedinherited

◆ temp_buffer

Vector<char> temp_buffer {HTTP_MAX_LEN}
protectedinherited

◆ timeout_ms

int timeout_ms = URL_CLIENT_TIMEOUT
protectedinherited

◆ url_path

Str url_path {70}
protectedinherited

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