Botan 3.13.0
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 Headersheaders () 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 63 of file http_util.h.

Constructor & Destructor Documentation

◆ Response() [1/2]

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

Definition at line 65 of file http_util.h.

65: 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 67 of file http_util.h.

67 :
68 m_status_code(status_code),
69 m_status_message(std::move(status_message)),
70 m_body(std::move(body)),
71 m_headers(std::move(headers)) {}
const std::vector< uint8_t > & body() const
Definition http_util.h:75
const Headers & headers() const
Definition http_util.h:77
unsigned int status_code() const
Definition http_util.h:73
std::string status_message() const
Definition http_util.h:79

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 75 of file http_util.h.

75{ return m_body; }

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

◆ headers()

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

Definition at line 77 of file http_util.h.

77{ return m_headers; }

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

◆ status_code()

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

Definition at line 73 of file http_util.h.

73{ return m_status_code; }

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

◆ status_message()

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

Definition at line 79 of file http_util.h.

79{ 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 81 of file http_util.h.

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

References status_code(), and status_message().


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