MessageHeader Class Reference

#include <Pt/Http/Message.h>

HTTP message header.

Inherits NonCopyable.

Classes

class  ConstIterator
 HTTP header field iterator. More...
 
class  Field
 Field of a HTTP header. More...
 

Public Member Functions

 MessageHeader ()
 Default constructor.
 
 ~MessageHeader ()
 Denstructor.
 
void clear ()
 Clears all content.
 
void set (const char *key, const char *value)
 Sets a header field.
 
void add (const char *key, const char *value)
 Adds a header field.
 
void remove (const char *key)
 Removes a header field.
 
const char * get (const char *key) const
 Returns a field value.
 
bool has (const char *key) const
 Returns true if the field is present.
 
bool isSet (const char *key, const char *value) const
 Returns true if the field is set to the value.
 
ConstIterator begin () const
 Returns the begin of the header fields.
 
ConstIterator end () const
 Returns the end of the header fields.
 
unsigned versionMajor () const
 Returns the major HTTP version number.
 
unsigned versionMinor () const
 Returns the minor HTTP version number.
 
void setVersion (unsigned major, unsigned minor)
 Sets the HTTP version number.
 
bool isChunked () const
 Returns true if chunked encoding is set.
 
std::size_t contentLength () const
 Returns the content length.
 
bool isKeepAlive () const
 Returns true if HTTP keep-alive is set.
 
void setKeepAlive ()
 Sets the HTTP keep-alive header.