|
Public Types |
typedef std::map< std::string,
std::string > | header_map |
| Type of data member that contains headers (except cookies).
|
typedef header_map::iterator | iterator |
| Iterator type that allows access to header strings (except cookies).
|
typedef header_map::const_iterator | const_iterator |
| Const Iterator type that allows access to header strings (except cookies).
|
Public Member Functions |
| HttpHeader (const std::string &content="text/plain", bool debug=false) |
| Constructor.
|
bool | debug () const |
const_iterator | begin () const |
const_iterator | end () const |
iterator | begin () |
iterator | end () |
size_t | size () const |
HttpHeader & | nocache () |
| Add header strings that prevent browser from caching the page.
|
HttpHeader & | cookie (const std::string &name, const std::string &value="", const std::string &path="/") |
| Set cookie name = value for path.
|
HttpHeader & | content_type (const std::string &value) |
| Add header strings to set content type.
|
HttpHeader & | location (const std::string &value) |
| Add header string to redirect browser to a given url.
|
HttpHeader & | refresh (size_t duration=0, const std::string &url="") |
| Add header string to refresh browser.
|
HttpHeader & | add (const std::string &name, const std::string &value) |
| General header add function.
|
HttpHeader & | erase (const std::string &name) |
| Remove any header with a given name.
|
HttpHeader & | clear () |
| Remove all header strings.
|
Private Types |
typedef std::map< std::string,
std::pair< std::string, std::string > > | cookie_map |
Private Attributes |
bool | debug_ |
header_map | headers_ |
cookie_map | cookies_ |
Friends |
std::ostream & | operator<< (std::ostream &os, const HttpHeader &header) |
| Output header strings and cookie definitions.
|
The class makes it convenient to set up standard headers and cookies for the response: