1 #ifndef NOOS_CLOUD_HTTP_RESPONSE 2 #define NOOS_CLOUD_HTTP_RESPONSE 6 #include <noos/cloud/asio/includes.ihh> 7 #include <boost/asio.hpp> 11 typedef boost::system::error_code error_code;
23 error_code
operator()(
unsigned int status_code);
45 http_response(std::function<
void(error_code error)> callback);
54 unsigned int content_length();
57 unsigned int strip_http_header(
unsigned int bytes);
60 std::string to_string();
63 unsigned int bytes_received()
const;
69 bool check_http_header();
72 bool consume_buffer(std::function<
void(std::string)> callback,
79 boost::asio::streambuf buffer_;
80 std::string reply_string;
82 std::function<void(error_code error)> error_cb_;
83 unsigned int bytes_transferred_ = 0;
84 unsigned int content_length_ = 0;
85 std::atomic<bool> once_ = {
false};
class for taking the body of the streambuf , in other case it will return an error ...
Definition: http_response.hpp:38
Definition: asio_handler.hpp:14
error_code operator()(unsigned int status_code)
operator which translates HTTP code errors
show the specific error due to a protocol error
Definition: http_response.hpp:19