Botan 3.3.0
Crypto and TLS for C&
Public Member Functions | List of all members
Botan::HTTP::Response Class Referencefinal

#include <http_util.h>

Public Member Functions

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

Detailed Description

Definition at line 31 of file http_util.h.

Constructor & Destructor Documentation

◆ Response() [1/2]

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

Definition at line 33 of file http_util.h.

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

◆ Response() [2/2]

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

Definition at line 35 of file http_util.h.

38 :
39 m_status_code(status_code), m_status_message(status_message), m_body(body), m_headers(headers) {}
const std::vector< uint8_t > & body() const
Definition http_util.h:43
const std::map< std::string, std::string > & headers() const
Definition http_util.h:45
unsigned int status_code() const
Definition http_util.h:41
std::string status_message() const
Definition http_util.h:47

Member Function Documentation

◆ body()

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

Definition at line 43 of file http_util.h.

43{ return m_body; }

Referenced by Botan::HTTP::operator<<().

◆ headers()

const std::map< std::string, std::string > & Botan::HTTP::Response::headers ( ) const
inline

Definition at line 45 of file http_util.h.

45{ return m_headers; }

Referenced by Botan::HTTP::operator<<().

◆ status_code()

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

Definition at line 41 of file http_util.h.

41{ return m_status_code; }

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

◆ status_message()

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

Definition at line 47 of file http_util.h.

47{ return m_status_message; }

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

◆ throw_unless_ok()

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

Definition at line 49 of file http_util.h.

49 {
50 if(status_code() != 200) {
51 throw HTTP_Error(status_message());
52 }
53 }

References status_code(), and status_message().


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