Public Types | Public Member Functions | List of all members
util::http::HttpsClient Class Reference

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)
 
SslStreamclient ()
 
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
 

Detailed Description

Definition at line 28 of file https_client.h.

Constructor & Destructor Documentation

◆ HttpsClient()

util::http::HttpsClient::HttpsClient ( absl::string_view  host,
IoContext io_context,
::boost::asio::ssl::context *  ssl_ctx 
)

Construct a new Https Client object.

Parameters
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.

Member Function Documentation

◆ Send() [1/2]

template<typename Req >
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.

◆ Send() [2/2]

template<typename Req , typename Resp >
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.


The documentation for this class was generated from the following files: