Public Types | |
using | error_code = ::boost::system::error_code |
Public Member Functions | |
HttpsClient (absl::string_view host, IoContext *io_context, ::boost::asio::ssl::context *ssl_ctx) | |
Construct a new Https Client object. More... | |
HttpsClient (const HttpsClient &)=delete | |
HttpsClient (HttpsClient &&)=delete | |
error_code | Connect (unsigned msec) |
template<typename Req > | |
error_code | Send (const Req &req) |
Sends http request but does not read response back. More... | |
template<typename Req , typename Resp > | |
error_code | Send (const Req &req, Resp *resp) |
Sends http request and reads response back. More... | |
error_code | ReadHeader (::boost::beast::http::basic_parser< false > *parser) |
template<typename Parser > | |
error_code | Read (Parser *parser) |
error_code | DrainResponse (::boost::beast::http::response_parser<::boost::beast::http::buffer_body > *parser) |
SslStream * | client () |
void | schedule_reconnect () |
int32_t | native_handle () |
uint32_t | retry_count () const |
void | set_retry_count (uint32_t cnt) |
Sets number of retries for Send(...) methods. | |
::boost::asio::ssl::context & | ssl_context () |
error_code | status () const |
template<typename Req , typename Resp > | |
auto | Send (const Req &req, Resp *resp) -> error_code |
template<typename Req > | |
auto | Send (const Req &req) -> error_code |
template<typename Parser > | |
auto | Read (Parser *parser) -> error_code |
Definition at line 28 of file https_client.h.
util::http::HttpsClient::HttpsClient | ( | absl::string_view | host, |
IoContext * | io_context, | ||
::boost::asio::ssl::context * | ssl_ctx | ||
) |
Construct a new Https Client object.
host | - a domain of the service like "www.googleapis.com" |
io_context | - IoContext thread in which the connection is running. HttpsClient should be called only from this thread. |
ssl_ctx | - SSL context for this connection. |
Definition at line 85 of file https_client.cc.
error_code util::http::HttpsClient::Send | ( | const Req & | req | ) |
Sends http request but does not read response back.
Possibly retries and reconnects if there are problems with connection. See set_retry_count(uint32_t) method.
error_code util::http::HttpsClient::Send | ( | const Req & | req, |
Resp * | resp | ||
) |
Sends http request and reads response back.
Possibly retries and reconnects if there are problems with connection. See set_retry_count(uint32_t) method for details.