Lazy RSS
Public Member Functions | List of all members
http::HTTP_Response Class Reference

Represents HTTP(s) response. More...

#include <http.hpp>

Public Member Functions

 HTTP_Response (int status, const std::string &reason, std::string &body) noexcept(true)
 Creates HTTP Response. More...
 
int status () const
 
const std::string & reason () const
 
const std::string & body () const
 
 operator bool () const
 
 operator! () const
 
 operator std::string () const
 String representation of HTTP Response. More...
 

Detailed Description

Represents HTTP(s) response.

Constructor & Destructor Documentation

HTTP_Response::HTTP_Response ( int  status,
const std::string &  reason,
std::string &  body 
)
noexcept

Creates HTTP Response.

Parameters
statusStatus code of Request.
reasonReason description.
bodyContent of response. Moved.

Member Function Documentation

const std::string & HTTP_Response::body ( ) const
Returns
Content of response.
HTTP_Response::operator bool ( ) const
Returns
Whether response is success or not.
Return values
trueIf response code is either 200 or 201
falseOtherwise.
HTTP_Response::operator std::string ( ) const
explicit

String representation of HTTP Response.

Can be used as debug information.

HTTP_Response::operator! ( ) const
Returns
Whether response is failure or not.
const std::string & HTTP_Response::reason ( ) const
Returns
Reason description of status code.
int HTTP_Response::status ( ) const
Returns
Status code of response.

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