SMACC2
|
#include <http_session.hpp>
Public Member Functions | |
http_session (boost::asio::any_io_executor ioc, const std::function< void(const TResponse &)> response) | |
virtual | ~http_session () |
void | run (const std::string &host, const std::string &target, const boost::beast::http::verb http_method, const int &version) override |
std::string | getPort () override |
Public Member Functions inherited from cl_http::http_session_base | |
virtual | ~http_session_base () |
Private Member Functions | |
void | on_resolve (boost::beast::error_code ec, boost::asio::ip::tcp::resolver::results_type results) override |
void | fail (boost::beast::error_code ec, const char *what) override |
void | on_connect (boost::beast::error_code ec, boost::asio::ip::tcp::resolver::results_type::endpoint_type) override |
void | on_write (boost::beast::error_code ec, std::size_t bytes_transferred) override |
void | on_read (boost::beast::error_code ec, std::size_t bytes_transferred) override |
void | setBody (const std::string &body) override |
void | setHeaders (const std::unordered_map< std::string, std::string > &headers) override |
Private Attributes | |
const std::string | kPort = "80" |
std::function< void(const TResponse &)> | onResponse |
boost::asio::ip::tcp::resolver | resolver_ |
boost::beast::tcp_stream | stream_ |
boost::beast::flat_buffer | buffer_ |
boost::beast::http::request< boost::beast::http::string_body > | req_ |
TResponse | res_ |
Additional Inherited Members | |
Public Types inherited from cl_http::http_session_base | |
using | TResponse = boost::beast::http::response< boost::beast::http::string_body > |
Protected Member Functions inherited from cl_http::http_session_base | |
virtual void | on_handshake (boost::beast::error_code ec) |
virtual void | on_shutdown (boost::beast::error_code ec) |
Definition at line 35 of file http_session.hpp.
cl_http::http_session::http_session | ( | boost::asio::any_io_executor | ioc, |
const std::function< void(const TResponse &)> | response | ||
) |
Definition at line 27 of file http_session.cpp.
|
inlinevirtual |
Definition at line 43 of file http_session.hpp.
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 65 of file http_session.cpp.
References onResponse, and res_.
Referenced by on_connect(), on_read(), on_resolve(), and on_write().
|
inlineoverridevirtual |
Implements cl_http::http_session_base.
Definition at line 50 of file http_session.hpp.
References kPort.
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 74 of file http_session.cpp.
References fail(), on_write(), req_, and stream_.
Referenced by on_resolve().
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 99 of file http_session.cpp.
References fail(), onResponse, res_, and stream_.
Referenced by on_write().
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 52 of file http_session.cpp.
References fail(), on_connect(), and stream_.
Referenced by run().
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 87 of file http_session.cpp.
References buffer_, fail(), on_read(), res_, and stream_.
Referenced by on_connect().
|
overridevirtual |
Implements cl_http::http_session_base.
Definition at line 35 of file http_session.cpp.
References kPort, on_resolve(), req_, and resolver_.
|
overrideprivatevirtual |
Implements cl_http::http_session_base.
Definition at line 33 of file http_session.cpp.
References req_.
|
inlineoverrideprivatevirtual |
|
private |
Definition at line 70 of file http_session.hpp.
Referenced by on_write().
|
private |
Definition at line 53 of file http_session.hpp.
|
private |
Definition at line 66 of file http_session.hpp.
|
private |
Definition at line 71 of file http_session.hpp.
Referenced by on_connect(), run(), and setBody().
|
private |
Definition at line 72 of file http_session.hpp.
Referenced by fail(), on_read(), and on_write().
|
private |
Definition at line 68 of file http_session.hpp.
Referenced by run().
|
private |
Definition at line 69 of file http_session.hpp.
Referenced by on_connect(), on_read(), on_resolve(), and on_write().