28 #ifndef HTTP_PARSER_RESPONSE_HPP 29 #define HTTP_PARSER_RESPONSE_HPP 34 #include <websocketpp/http/parser.hpp> 60 typedef lib::shared_ptr<type> ptr;
64 , m_buf(lib::make_shared<std::string>())
65 , m_status_code(status_code::uninitialized)
66 , m_state(RESPONSE_LINE) {}
117 return m_state == DONE;
122 return (m_state == BODY || m_state == DONE);
126 std::string
raw()
const;
149 void set_status(status_code::value code, std::string
const & msg);
153 return m_status_code;
162 void process(std::string::iterator begin, std::string::iterator end);
165 size_t process_body(
char const * buf, size_t len);
174 std::string m_status_msg;
176 lib::shared_ptr<std::string> m_buf;
177 status_code::value m_status_code;
186 #include <websocketpp/http/impl/response.hpp> bool ready() const
Returns true if the response is ready.
status_code::value get_status_code() const
Return the response status code.
void set_status(status_code::value code, std::string const &msg)
Set response status code and message.
Stores, parses, and manipulates HTTP responses.
size_t consume(std::istream &s)
Process bytes in the input buffer (istream version)
size_t const istream_buffer
Number of bytes to use for temporary istream read buffers.
std::string raw() const
Returns the full raw response.
void handle_accept(connection_ptr con, lib::error_code const &ec)
Handler callback for start_accept.
void set_status(status_code::value code)
Set response status code and message.
size_t consume(char const *buf, size_t len)
Process bytes in the input buffer.
bool headers_ready() const
Returns true if the response headers are fully parsed.
const std::string & get_status_msg() const
Return the response status message.