Botan 2.19.5 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, const std::string &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 ()

## Detailed Description

Definition at line 39 of file http_util.h.

## Constructor & Destructor Documentation

## ◆ Response() [1/2]

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

Definition at line 42 of file http_util.h.

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

## ◆ Response() [2/2]

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

Definition at line 44 of file http_util.h.

46 :
47 m_status_code(status_code),
48 m_status_message(status_message),
49 m_body(body),
50 m_headers(headers) {}
Botan::HTTP::Response::body
const std::vector< uint8_t > & body() const
Definition: http_util.h:54
Botan::HTTP::Response::headers
const std::map< std::string, std::string > & headers() const
Definition: http_util.h:56
Botan::HTTP::Response::status_code
unsigned int status_code() const
Definition: http_util.h:52
Botan::HTTP::Response::status_message
std::string status_message() const
Definition: http_util.h:58

## Member Function Documentation

## ◆ body()

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

Definition at line 54 of file http_util.h.

54{ 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 56 of file http_util.h.

56{ return m_headers; }

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

## ◆ status_code()

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

Definition at line 52 of file http_util.h.

52{ return m_status_code; }

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

## ◆ status_message()

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

Definition at line 58 of file http_util.h.

58{ return m_status_message; }

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

## ◆ throw_unless_ok()

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

Definition at line 60 of file http_util.h.

61 {
62 if(status_code() != 200)
63 throw HTTP_Error(status_message());
64 }

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

- src/lib/utils/http_util/http_util.h