Botan  1.11.15
Public Member Functions
Botan::HTTP::Response Struct Reference

#include <http_util.h>

List of all members.

Public Member Functions

const std::vector< byte > & 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< byte > &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

Definition at line 25 of file http_util.h.

: m_status_code(0), m_status_message("Uninitialized") {}
Botan::HTTP::Response::Response ( unsigned int  status_code,
const std::string &  status_message,
const std::vector< byte > &  body,
const std::map< std::string, std::string > &  headers 
) [inline]

Definition at line 27 of file http_util.h.

                                                            :
         m_status_code(status_code),
         m_status_message(status_message),
         m_body(body),
         m_headers(headers) {}

Member Function Documentation

const std::vector<byte>& Botan::HTTP::Response::body ( ) const [inline]

Definition at line 37 of file http_util.h.

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

{ 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<<().

{ 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().

{ 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().

{ return m_status_message; }

Definition at line 43 of file http_util.h.

References status_code(), and status_message().

         {
         if(status_code() != 200)
            throw std::runtime_error("HTTP error: " + status_message());
         }

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