Botan 3.14.1
Crypto and TLS for C&
Botan::HTTP::Response Class Referencefinal

#include <http_util.h>

Public Member Functions

const std::vector< uint8_t > & body () const
const Headers & headers () const
 Response ()
 Response (unsigned int status_code, std::string status_message, std::vector< uint8_t > body, Headers headers)
unsigned int status_code () const
std::string status_message () const
void throw_unless_ok () const

Detailed Description

Definition at line 62 of file http_util.h.

Constructor & Destructor Documentation

◆ Response() [1/2]

Botan::HTTP::Response::Response ( )
inline

Definition at line 64 of file http_util.h.

64: m_status_code(0), m_status_message("Uninitialized") {}

◆ Response() [2/2]

Botan::HTTP::Response::Response ( unsigned int status_code,
std::string status_message,
std::vector< uint8_t > body,
Headers headers )
inline

Definition at line 66 of file http_util.h.

66 :
67 m_status_code(status_code),
68 m_status_message(std::move(status_message)),
69 m_body(std::move(body)),
70 m_headers(std::move(headers)) {}
const std::vector< uint8_t > & body() const
Definition http_util.h:74
const Headers & headers() const
Definition http_util.h:76
unsigned int status_code() const
Definition http_util.h:72
std::string status_message() const
Definition http_util.h:78

References body(), headers(), status_code(), and status_message().

Member Function Documentation

◆ body()

const std::vector< uint8_t > & Botan::HTTP::Response::body ( ) const
inline

Definition at line 74 of file http_util.h.

74{ return m_body; }

Referenced by Botan::HTTP::operator<<(), and Response().

◆ headers()

const Headers & Botan::HTTP::Response::headers ( ) const
inline

Definition at line 76 of file http_util.h.

76{ return m_headers; }

Referenced by Botan::HTTP::operator<<(), and Response().

◆ status_code()

unsigned int Botan::HTTP::Response::status_code ( ) const
inline

Definition at line 72 of file http_util.h.

72{ return m_status_code; }

Referenced by Botan::HTTP::operator<<(), Response(), and throw_unless_ok().

◆ status_message()

std::string Botan::HTTP::Response::status_message ( ) const
inline

Definition at line 78 of file http_util.h.

78{ return m_status_message; }

Referenced by Botan::HTTP::operator<<(), Response(), and throw_unless_ok().

◆ throw_unless_ok()

void Botan::HTTP::Response::throw_unless_ok ( ) const
inline

Definition at line 80 of file http_util.h.

80 {
81 if(status_code() != 200) {
82 throw HTTP_Error(status_message());
83 }
84 }

References status_code(), and status_message().


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