Virgil Security C++ SDK
|
This is base class for all HTTP responses. More...
#include <Response.h>
Public Types | |
enum | StatusCode { OK = 200, CREATED = 201, REQUEST_ERROR = 400, AUTHORIZATION_ERROR = 401, FORBIDDEN = 403, ENTITY_NOT_FOUND = 404, METHOD_NOT_ALLOWED = 405, SERVER_ERROR = 500 } |
HTTP response codes. | |
Types aliases | |
using | Header = std::map< std::string, std::string, util::CaseInsensitiveCompare > |
using | Parameters = std::map< std::string, std::string > |
Public Member Functions | |
bool | fail () const |
Return true if response contains error status code. | |
Accessors | |
Response & | body (const std::string &body) |
Set response body. | |
std::string | body () const |
Return response body. | |
Response & | contentType (const std::string &contentType) |
Set response content type. | |
std::string | contentType () const |
Return response content type. | |
Response & | header (const Header &header) |
Set response header. | |
Header | header () const |
Get response header. | |
Response & | statusCode (StatusCode statusCode) |
Set response status code. | |
StatusCode | statusCode () const |
Return response status code. | |
Response & | statusCodeRaw (int code) |
Set response status code from integer value. More... | |
int | statusCodeRaw () const |
Return response status code integer value. | |
This is base class for all HTTP responses.
Response& virgil::sdk::client::networking::Response::statusCodeRaw | ( | int | code | ) |
Set response status code from integer value.
std::logic_error | - if given code is not found in Response::StatusCode enum. |