The Header class encapsulates the headers of an HTTP request/response.
More...
#include <header.h>
|
virtual | ~Header ()=default |
|
virtual bool | has (const std::string &key, const std::string &value) const |
| has checks if the header contains an entry for the given key with the given value. More...
|
|
virtual bool | has (const std::string &key) const |
| has checks if the header contains any entry for the given key. More...
|
|
virtual void | add (const std::string &key, const std::string &value) |
| add adds the given value for the given key to the header. More...
|
|
virtual void | remove (const std::string &key) |
| remove erases all values for the given key from the header. More...
|
|
virtual void | remove (const std::string &key, const std::string &value) |
| remove erases the given value for the given key from the header. More...
|
|
virtual void | set (const std::string &key, const std::string &value) |
| set assigns the given value to the entry with key 'key' and replaces any previous value. More...
|
|
virtual void | enumerate (const std::function< void(const std::string &, const std::set< std::string > &)> &enumerator) const |
| enumerate iterates over the known fields and invokes the given enumerator for each of them. More...
|
|
|
static std::string | canonicalize_key (const std::string &key) |
| canonicalize_key returns the canonical form of the header key 'key'. More...
|
|
The Header class encapsulates the headers of an HTTP request/response.
Definition at line 37 of file header.h.
virtual core::net::http::Header::~Header |
( |
| ) |
|
|
virtualdefault |
virtual void core::net::http::Header::add |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
|
virtual |
add adds the given value for the given key to the header.
static std::string core::net::http::Header::canonicalize_key |
( |
const std::string & |
key | ) |
|
|
static |
canonicalize_key returns the canonical form of the header key 'key'.
The canonicalization converts the first letter and any letter following a hyphen to upper case; the rest are converted to lowercase. For example, the canonical key for "accept-encoding" is "Accept-Encoding".
- Parameters
-
key | The key to be canonicalized. |
virtual void core::net::http::Header::enumerate |
( |
const std::function< void(const std::string &, const std::set< std::string > &)> & |
enumerator | ) |
const |
|
virtual |
enumerate iterates over the known fields and invokes the given enumerator for each of them.
virtual bool core::net::http::Header::has |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| const |
|
virtual |
has checks if the header contains an entry for the given key with the given value.
- Parameters
-
key | The key into the header map. |
value | The value to check for. |
virtual bool core::net::http::Header::has |
( |
const std::string & |
key | ) |
const |
|
virtual |
has checks if the header contains any entry for the given key.
- Parameters
-
key | The key into the header map. |
virtual void core::net::http::Header::remove |
( |
const std::string & |
key | ) |
|
|
virtual |
remove erases all values for the given key from the header.
virtual void core::net::http::Header::remove |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
|
virtual |
remove erases the given value for the given key from the header.
virtual void core::net::http::Header::set |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
|
virtual |
set assigns the given value to the entry with key 'key' and replaces any previous value.
The documentation for this class was generated from the following file:
- /build/net-cpp-wObqh_/net-cpp-2.0.0/include/core/net/http/header.h