Virgil Security C++ SDK
Public Types | Public Member Functions | List of all members
virgil::sdk::client::networking::Response Class Reference

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
Responsebody (const std::string &body)
 Set response body.
 
std::string body () const
 Return response body.
 
ResponsecontentType (const std::string &contentType)
 Set response content type.
 
std::string contentType () const
 Return response content type.
 
Responseheader (const Header &header)
 Set response header.
 
Header header () const
 Get response header.
 
ResponsestatusCode (StatusCode statusCode)
 Set response status code.
 
StatusCode statusCode () const
 Return response status code.
 
ResponsestatusCodeRaw (int code)
 Set response status code from integer value. More...
 
int statusCodeRaw () const
 Return response status code integer value.
 

Detailed Description

This is base class for all HTTP responses.

Note
This class belongs to the private API

Member Function Documentation

Response& virgil::sdk::client::networking::Response::statusCodeRaw ( int  code)

Set response status code from integer value.

Exceptions
std::logic_error- if given code is not found in Response::StatusCode enum.

The documentation for this class was generated from the following file: