HTTP message.
More...
#include <httpmessage.hpp>
|
| virtual int | parseFirstLine (const std::string &line)=0 |
| | parse first line.
|
| |
| virtual int | parseHeader (const std::string &head) |
| | parse HTTP header.
|
| |
|
| static const std::streamsize | _maxHeaderLen = 2048 |
| | HTTP max header size.
|
| |
◆ HeaderMap
◆ HttpMessage() [1/3]
| HttpMessage::HttpMessage |
( |
| ) |
|
◆ HttpMessage() [2/3]
◆ HttpMessage() [3/3]
◆ ~HttpMessage()
| virtual join::HttpMessage::~HttpMessage |
( |
| ) |
|
|
virtualdefault |
◆ clear()
| void HttpMessage::clear |
( |
| ) |
|
|
virtual |
◆ contentLength()
| size_t HttpMessage::contentLength |
( |
| ) |
const |
get content length.
- Returns
- content length.
◆ dumpHeaders()
| std::string HttpMessage::dumpHeaders |
( |
| ) |
const |
dump headers.
- Returns
- headers.
◆ hasHeader()
| bool HttpMessage::hasHeader |
( |
const std::string & | name | ) |
const |
checks if there is a header with the specified name.
- Parameters
-
| name | name of the header to search for. |
- Returns
- true of there is such a header, false otherwise.
◆ header() [1/3]
| void HttpMessage::header |
( |
const HeaderMap::value_type & | h | ) |
|
add header to the HTTP request.
- Parameters
-
◆ header() [2/3]
| std::string HttpMessage::header |
( |
const std::string & | name | ) |
const |
get header by name.
- Parameters
-
- Returns
- header value.
◆ header() [3/3]
| void HttpMessage::header |
( |
const std::string & | name, |
|
|
const std::string & | val ) |
add header to the HTTP request.
- Parameters
-
| name | header name. |
| val | header value. |
◆ headers() [1/2]
get headers map.
- Returns
- headers map.
◆ headers() [2/2]
| void HttpMessage::headers |
( |
const HeaderMap & | heads | ) |
|
add headers to the HTTP request.
- Parameters
-
◆ operator=() [1/2]
assign the HttpMessage instance by copy.
- Parameters
-
- Returns
- a reference of the current object.
◆ operator=() [2/2]
assign the HttpMessage instance by move.
- Parameters
-
- Returns
- a reference of the current object.
◆ parseFirstLine()
| virtual int join::HttpMessage::parseFirstLine |
( |
const std::string & | line | ) |
|
|
protectedpure virtual |
◆ parseHeader()
| int HttpMessage::parseHeader |
( |
const std::string & | head | ) |
|
|
protectedvirtual |
parse HTTP header.
- Parameters
-
| head | HTTP header to parse. |
- Returns
- 0 on success, -1 on failure.
◆ readHeaders()
| int HttpMessage::readHeaders |
( |
std::istream & | in | ) |
|
|
virtual |
read HTTP header from the given input stream.
- Parameters
-
- Returns
- 0 on success, -1 on failure.
◆ version() [1/2]
| const std::string & HttpMessage::version |
( |
| ) |
const |
get HTTP version.
- Returns
- HTTP version.
◆ version() [2/2]
| void HttpMessage::version |
( |
const std::string & | v | ) |
|
set HTTP version (default "HTTP/1.1").
- Parameters
-
◆ writeHeaders()
| virtual int join::HttpMessage::writeHeaders |
( |
std::ostream & | out | ) |
const |
|
pure virtual |
◆ _headers
◆ _maxHeaderLen
| const std::streamsize join::HttpMessage::_maxHeaderLen = 2048 |
|
staticprotected |
◆ _version
| std::string join::HttpMessage::_version |
|
protected |
The documentation for this class was generated from the following files: