Botan  2.1.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::HTTP::Response Struct Reference

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

Constructor & Destructor Documentation

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

Definition at line 25 of file http_util.h.

25 : m_status_code(0), m_status_message("Uninitialized") {}
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 27 of file http_util.h.

29  :
30  m_status_code(status_code),
31  m_status_message(status_message),
32  m_body(body),
33  m_headers(headers) {}
const std::vector< uint8_t > & body() const
Definition: http_util.h:37
const std::map< std::string, std::string > & headers() const
Definition: http_util.h:39
unsigned int status_code() const
Definition: http_util.h:35
std::string status_message() const
Definition: http_util.h:41

Member Function Documentation

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

Definition at line 37 of file http_util.h.

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

37 { return m_body; }
const std::map<std::string, std::string>& Botan::HTTP::Response::headers ( ) const
inline

Definition at line 39 of file http_util.h.

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

39 { return m_headers; }
unsigned int Botan::HTTP::Response::status_code ( ) const
inline

Definition at line 35 of file http_util.h.

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

35 { return m_status_code; }
std::string Botan::HTTP::Response::status_message ( ) const
inline

Definition at line 41 of file http_util.h.

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

41 { return m_status_message; }
void Botan::HTTP::Response::throw_unless_ok ( )
inline

Definition at line 43 of file http_util.h.

References status_code(), and status_message().

44  {
45  if(status_code() != 200)
46  throw Exception("HTTP error: " + status_message());
47  }
unsigned int status_code() const
Definition: http_util.h:35
std::string status_message() const
Definition: http_util.h:41

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