|
Web framework C++
2.0.0
Simple web framework on c++ designed to easily create web pages, etc
|
class wrapper of HTTP response More...
#include <response.h>


Public Member Functions | |
| Response () | |
| Response (const char *body) | |
| Response (HTTP::Version version, int status, Headers &headers, MessageBody &body) | |
| ~Response () | |
| void | setVersion (HTTP::Version version) |
| void | setStatus (int status) |
| void | setHeaders (Headers &headers) |
| void | setBody (MessageBody &body) |
| HTTP::Version | getVersion () |
| int | getStatus () |
| Headers * | getHeaders () |
| MessageBody * | getBody () |
| void | finalize () |
| bool | isFinalized () |
| void | setElapsedTime (std::chrono::duration< double, std::milli > ms) |
| std::chrono::duration< double, std::milli > | getElapsedTime () |
class wrapper of HTTP response
Object of this class is representation http response
| Response::Response | ( | ) |
Create empty response with code status 501 and http version HTTP_UNDEFINED
| Response::Response | ( | const char * | body | ) |
Create response with body s MessageBody object and other default params: http version 1.1, ttp response code status 200 and empty headers
| body | http response body as MessageBody object |
| Response::Response | ( | HTTP::Version | version, |
| int | status, | ||
| Headers & | headers, | ||
| MessageBody & | body | ||
| ) |
Create response and fill it with declared arguments
| version | http version of response |
| status | http response code status |
| headers | http response headers as Headers object |
| body | http response body as MessageBody object |
| Response::~Response | ( | ) |
deletes Headers and MessageBody objects
| void Response::finalize | ( | ) |
| MessageBody* Response::getBody | ( | ) |
get body of http response
| std::chrono::duration<double, std::milli> Response::getElapsedTime | ( | ) |
| Headers* Response::getHeaders | ( | ) |
get headers of http response
| int Response::getStatus | ( | ) |
get http code status of response
| HTTP::Version Response::getVersion | ( | ) |
get http version of response
| bool Response::isFinalized | ( | ) |
| void Response::setBody | ( | MessageBody & | body | ) |
Set to response MessageBody object and deleting previous one
| body | MessageBody object |
| void Response::setElapsedTime | ( | std::chrono::duration< double, std::milli > | ms | ) |
| ms |
| void Response::setHeaders | ( | Headers & | headers | ) |
Set to response Headers object and deleting previous one
| headers | headers object |
| void Response::setStatus | ( | int | status | ) |
Set to response http status
| status | http code status |
| void Response::setVersion | ( | HTTP::Version | version | ) |
Set to response http version
| version | value of enum HTTP::Version, which represents http version. |
1.8.11