28 #ifndef HTTP_PARSER_RESPONSE_HPP
29 #define HTTP_PARSER_RESPONSE_HPP
31 #include <websocketpp/http/parser.hpp>
57 typedef lib::shared_ptr<type> ptr;
61 , m_buf(lib::make_shared<std::string>())
62 , m_status_code(status_code::uninitialized)
63 , m_state(RESPONSE_LINE) {}
85 size_t consume(
const char *buf,
size_t len);
87 size_t consume(std::istream & s);
94 return m_state == DONE;
99 return (m_state == BODY || m_state == DONE);
106 std::string
raw()
const;
129 void set_status(status_code::value code,
const std::string& msg);
133 return m_status_code;
142 void process(std::string::iterator begin, std::string::iterator end);
145 size_t process_body(
const char *buf,
size_t len);
154 std::string m_status_msg;
156 lib::shared_ptr<std::string> m_buf;
157 status_code::value m_status_code;
166 #include <websocketpp/http/impl/response.hpp>
168 #endif // HTTP_PARSER_RESPONSE_HPP
bool parse_complete(std::istream &s)
DEPRECATED parse a complete response from a pre-delimited istream.
status_code::value get_status_code() const
Return the response status code.
Stores, parses, and manipulates HTTP responses.
bool ready() const
Returns true if the response is ready.
size_t consume(const char *buf, size_t len)
Process bytes in the input buffer.
bool headers_ready() const
Returns true if the response headers are fully parsed.
Namespace for the WebSocket++ project.
void set_status(status_code::value code)
Set response status code and message.
const std::string & get_status_msg() const
Return the response status message.
std::string raw() const
Returns the full raw response.