25#ifndef MYSQL_ROUTER_REST_CLIENT_H_INCLUDED
26#define MYSQL_ROUTER_REST_CLIENT_H_INCLUDED
39 const std::string &username,
const std::string &
password)
40 : username_{username},
47 : username_{username},
54 : http_client_{
std::move(http_client)} {}
58 const std::string &request_body = {},
59 const std::string &content_type =
"application/json");
61 operator bool()
const {
return http_client_->operator bool(); }
63 std::string
error_msg()
const {
return http_client_->error_msg(); }
Definition: http_client.h:127
a HTTP request and response.
Definition: http_request.h:453
representation of HTTP URI.
Definition: http_request.h:391
std::string get_host() const
Definition: http_common.cc:358
uint16_t get_port() const
Definition: http_common.cc:368
IO Context for network operations.
Definition: http_client.h:43
Definition: rest_client.h:32
std::string error_msg() const
Definition: rest_client.h:63
RestClient(std::unique_ptr< HttpClient > &&http_client)
Definition: rest_client.h:53
std::string password_
Definition: rest_client.h:67
std::unique_ptr< HttpClient > http_client_
Definition: rest_client.h:68
std::string username_
Definition: rest_client.h:66
RestClient(IOContext &io_ctx, const std::string &address, uint16_t port)
Definition: rest_client.h:34
RestClient(IOContext &io_ctx, const std::string &address, uint16_t port, const std::string &username, const std::string &password)
Definition: rest_client.h:38
RestClient(IOContext &io_ctx, const HttpUri &u, const std::string &username, const std::string &password)
Definition: rest_client.h:45
#define HTTP_CLIENT_EXPORT
Definition: http_client_export.h:40
static char * password
Definition: mysql_secure_installation.cc:56
int type
Definition: http_request.h:253
Definition: gcs_xcom_synode.h:64
std::conditional_t< !std::is_array< T >::value, std::unique_ptr< T, detail::Deleter< T > >, std::conditional_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, detail::Array_deleter< std::remove_extent_t< T > > >, void > > unique_ptr
The following is a common type that is returned by all the ut::make_unique (non-aligned) specializati...
Definition: ut0new.h:2439
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
constexpr const char kRestAPIVersion[]
Definition: rest_client.h:30