|
join 1.0
lightweight network framework library
|
HTTP response. More...
#include <httpmessage.hpp>


Public Member Functions | |
| HttpResponse ()=default | |
| create the HttpResponse instance. | |
| HttpResponse (const HttpResponse &other) | |
| create the HttpResponse instance by copy. | |
| HttpResponse & | operator= (const HttpResponse &other) |
| assign the HttpResponse instance by copy. | |
| HttpResponse (HttpResponse &&other) | |
| create the HttpResponse instance by move. | |
| HttpResponse & | operator= (HttpResponse &&other) |
| assign the HttpResponse instance by move. | |
| virtual | ~HttpResponse ()=default |
| destroy the HttpResponse instance. | |
| const std::string & | status () const |
| get HTTP response status. | |
| const std::string & | reason () const |
| get HTTP response reason. | |
| void | response (const std::string &status, const std::string &reason={}) |
| set HTTP response status. | |
| virtual void | clear () override |
| clear HTTP message. | |
| virtual int | writeHeaders (std::ostream &out) const override |
| write HTTP headers to the given output stream. | |
Public Member Functions inherited from join::HttpMessage | |
| HttpMessage () | |
| create the HttpMessage instance. | |
| HttpMessage (const HttpMessage &other) | |
| create the HttpMessage instance by copy. | |
| HttpMessage & | operator= (const HttpMessage &other) |
| assign the HttpMessage instance by copy. | |
| HttpMessage (HttpMessage &&other) | |
| create the HttpMessage instance by move. | |
| HttpMessage & | operator= (HttpMessage &&other) |
| assign the HttpMessage instance by move. | |
| virtual | ~HttpMessage ()=default |
| destroy the HttpMessage instance. | |
| const std::string & | version () const |
| get HTTP version. | |
| void | version (const std::string &v) |
| set HTTP version (default "HTTP/1.1"). | |
| bool | hasHeader (const std::string &name) const |
| checks if there is a header with the specified name. | |
| std::string | header (const std::string &name) const |
| get header by name. | |
| void | header (const std::string &name, const std::string &val) |
| add header to the HTTP request. | |
| void | header (const HeaderMap::value_type &h) |
| add header to the HTTP request. | |
| const HeaderMap & | headers () const |
| get headers map. | |
| void | headers (const HeaderMap &heads) |
| add headers to the HTTP request. | |
| std::string | dumpHeaders () const |
| dump headers. | |
| size_t | contentLength () const |
| get content length. | |
| virtual int | readHeaders (std::istream &in) |
| read HTTP header from the given input stream. | |
Protected Member Functions | |
| virtual int | parseFirstLine (const std::string &line) override |
| parse first line. | |
Protected Member Functions inherited from join::HttpMessage | |
| virtual int | parseHeader (const std::string &head) |
| parse HTTP header. | |
Protected Attributes | |
| std::string | _status |
| HTTP status. | |
| std::string | _reason |
| HTTP reason. | |
Protected Attributes inherited from join::HttpMessage | |
| std::string | _version |
| HTTP version. | |
| HeaderMap | _headers |
| HTTP headers. | |
Additional Inherited Members | |
Public Types inherited from join::HttpMessage | |
| using | HeaderMap = std::map <std::string, std::string, details::lessNoCase> |
Static Protected Attributes inherited from join::HttpMessage | |
| static const std::streamsize | _maxHeaderLen = 2048 |
| HTTP max header size. | |
HTTP response.
|
default |
create the HttpResponse instance.
| HttpResponse::HttpResponse | ( | const HttpResponse & | other | ) |
create the HttpResponse instance by copy.
| other | request to copy. |
| HttpResponse::HttpResponse | ( | HttpResponse && | other | ) |
create the HttpResponse instance by move.
| other | request to move. |
|
virtualdefault |
destroy the HttpResponse instance.
|
overridevirtual |
clear HTTP message.
Reimplemented from join::HttpMessage.
| HttpResponse & HttpResponse::operator= | ( | const HttpResponse & | other | ) |
assign the HttpResponse instance by copy.
| other | request to copy. |
| HttpResponse & HttpResponse::operator= | ( | HttpResponse && | other | ) |
assign the HttpResponse instance by move.
| other | request to move. |
|
overrideprotectedvirtual |
parse first line.
| line | first line to parse. |
Implements join::HttpMessage.
| const std::string & HttpResponse::reason | ( | ) | const |
get HTTP response reason.
| void HttpResponse::response | ( | const std::string & | status, |
| const std::string & | reason = {} ) |
set HTTP response status.
| status | HTTP status. |
| reason | HTTP reason. |
| const std::string & HttpResponse::status | ( | ) | const |
get HTTP response status.
|
overridevirtual |
write HTTP headers to the given output stream.
| out | output stream. |
Implements join::HttpMessage.
|
protected |
HTTP reason.
|
protected |
HTTP status.