9 #ifndef _d7a272d7_9beb_43c1_a5a1_fce4c0245c80
10 #define _d7a272d7_9beb_43c1_a5a1_fce4c0245c80
30 typedef std::map<std::string, std::string>
Headers;
66 std::string
const &
get_header(std::string
const & name)
const;
69 void set_header(std::string
const & name, std::string
const & value);
81 Headers::const_iterator _find_header(std::string
const & name)
const;
RFC 5322 Message (i.e. headers with body).
Definition: Message.h:27
virtual ~Message()=default
void set_body(std::string const &body)
Set the body.
Message(Message &&)=default
std::string const & get_header(std::string const &name) const
Return a header value or throw an exception if the required header is missing.
Message(Headers const &headers={}, std::string const &body="")
Constructor.
void set_headers(Headers const &headers)
Set the headers.
bool has_header(std::string const &name) const
Test whether the given header exists.
std::map< std::string, std::string > Headers
Associative container for headers.
Definition: Message.h:30
Message & operator=(Message const &)=default
void set_header(std::string const &name, std::string const &value)
Set a header value.
Message(Message const &)=default
Message & operator=(Message &&)=default
Headers const & get_headers() const
Return the headers.
std::string const & get_body() const
Return the body.
std::istream & operator>>(std::istream &stream, HTTPRequest &request)
Input an HTTP request from a stream.
std::ostream & operator<<(std::ostream &stream, HTTPRequest const &request)
Output an HTTP request to a stream.
Definition: Association.h:25
#define ODIL_API
Definition: odil.h:28