D++ (DPP)
C++ Discord API Bot Library
httplib::Client Class Reference

#include <httplib.h>

Public Member Functions

 Client (const char *scheme_host_port)
 
 Client (const char *scheme_host_port, const std::string &client_cert_path, const std::string &client_key_path)
 
 Client (const std::string &host, int port)
 
 Client (const std::string &host, int port, const std::string &client_cert_path, const std::string &client_key_path)
 
 ~Client ()
 
bool is_valid () const
 
Result Get (const char *path)
 
Result Get (const char *path, const Headers &headers)
 
Result Get (const char *path, Progress progress)
 
Result Get (const char *path, const Headers &headers, Progress progress)
 
Result Get (const char *path, ContentReceiver content_receiver)
 
Result Get (const char *path, const Headers &headers, ContentReceiver content_receiver)
 
Result Get (const char *path, ContentReceiver content_receiver, Progress progress)
 
Result Get (const char *path, const Headers &headers, ContentReceiver content_receiver, Progress progress)
 
Result Get (const char *path, ResponseHandler response_handler, ContentReceiver content_receiver)
 
Result Get (const char *path, const Headers &headers, ResponseHandler response_handler, ContentReceiver content_receiver)
 
Result Get (const char *path, const Headers &headers, ResponseHandler response_handler, ContentReceiver content_receiver, Progress progress)
 
Result Get (const char *path, ResponseHandler response_handler, ContentReceiver content_receiver, Progress progress)
 
Result Get (const char *path, const Params &params, const Headers &headers, Progress progress=nullptr)
 
Result Get (const char *path, const Params &params, const Headers &headers, ContentReceiver content_receiver, Progress progress=nullptr)
 
Result Get (const char *path, const Params &params, const Headers &headers, ResponseHandler response_handler, ContentReceiver content_receiver, Progress progress=nullptr)
 
Result Head (const char *path)
 
Result Head (const char *path, const Headers &headers)
 
Result Post (const char *path)
 
Result Post (const char *path, const char *body, size_t content_length, const char *content_type)
 
Result Post (const char *path, const Headers &headers, const char *body, size_t content_length, const char *content_type)
 
Result Post (const char *path, const std::string &body, const char *content_type)
 
Result Post (const char *path, const Headers &headers, const std::string &body, const char *content_type)
 
Result Post (const char *path, size_t content_length, ContentProvider content_provider, const char *content_type)
 
Result Post (const char *path, ContentProviderWithoutLength content_provider, const char *content_type)
 
Result Post (const char *path, const Headers &headers, size_t content_length, ContentProvider content_provider, const char *content_type)
 
Result Post (const char *path, const Headers &headers, ContentProviderWithoutLength content_provider, const char *content_type)
 
Result Post (const char *path, const Params &params)
 
Result Post (const char *path, const Headers &headers, const Params &params)
 
Result Post (const char *path, const MultipartFormDataItems &items)
 
Result Post (const char *path, const Headers &headers, const MultipartFormDataItems &items)
 
Result Post (const char *path, const Headers &headers, const MultipartFormDataItems &items, const std::string &boundary)
 
Result Put (const char *path)
 
Result Put (const char *path, const char *body, size_t content_length, const char *content_type)
 
Result Put (const char *path, const Headers &headers, const char *body, size_t content_length, const char *content_type)
 
Result Put (const char *path, const std::string &body, const char *content_type)
 
Result Put (const char *path, const Headers &headers, const std::string &body, const char *content_type)
 
Result Put (const char *path, size_t content_length, ContentProvider content_provider, const char *content_type)
 
Result Put (const char *path, ContentProviderWithoutLength content_provider, const char *content_type)
 
Result Put (const char *path, const Headers &headers, size_t content_length, ContentProvider content_provider, const char *content_type)
 
Result Put (const char *path, const Headers &headers, ContentProviderWithoutLength content_provider, const char *content_type)
 
Result Put (const char *path, const Params &params)
 
Result Put (const char *path, const Headers &headers, const Params &params)
 
Result Patch (const char *path)
 
Result Patch (const char *path, const char *body, size_t content_length, const char *content_type)
 
Result Patch (const char *path, const Headers &headers, const char *body, size_t content_length, const char *content_type)
 
Result Patch (const char *path, const std::string &body, const char *content_type)
 
Result Patch (const char *path, const Headers &headers, const std::string &body, const char *content_type)
 
Result Patch (const char *path, size_t content_length, ContentProvider content_provider, const char *content_type)
 
Result Patch (const char *path, ContentProviderWithoutLength content_provider, const char *content_type)
 
Result Patch (const char *path, const Headers &headers, size_t content_length, ContentProvider content_provider, const char *content_type)
 
Result Patch (const char *path, const Headers &headers, ContentProviderWithoutLength content_provider, const char *content_type)
 
Result Delete (const char *path)
 
Result Delete (const char *path, const Headers &headers)
 
Result Delete (const char *path, const char *body, size_t content_length, const char *content_type)
 
Result Delete (const char *path, const Headers &headers, const char *body, size_t content_length, const char *content_type)
 
Result Delete (const char *path, const std::string &body, const char *content_type)
 
Result Delete (const char *path, const Headers &headers, const std::string &body, const char *content_type)
 
Result Options (const char *path)
 
Result Options (const char *path, const Headers &headers)
 
bool send (Request &req, Response &res, Error &error)
 
Result send (const Request &req)
 
size_t is_socket_open () const
 
void stop ()
 
void set_default_headers (Headers headers)
 
void set_address_family (int family)
 
void set_tcp_nodelay (bool on)
 
void set_socket_options (SocketOptions socket_options)
 
void set_connection_timeout (time_t sec, time_t usec=0)
 
template<class Rep , class Period >
void set_connection_timeout (const std::chrono::duration< Rep, Period > &duration)
 
void set_read_timeout (time_t sec, time_t usec=0)
 
template<class Rep , class Period >
void set_read_timeout (const std::chrono::duration< Rep, Period > &duration)
 
void set_write_timeout (time_t sec, time_t usec=0)
 
template<class Rep , class Period >
void set_write_timeout (const std::chrono::duration< Rep, Period > &duration)
 
void set_basic_auth (const char *username, const char *password)
 
void set_bearer_token_auth (const char *token)
 
void set_keep_alive (bool on)
 
void set_follow_location (bool on)
 
void set_compress (bool on)
 
void set_decompress (bool on)
 
void set_interface (const char *intf)
 
void set_proxy (const char *host, int port)
 
void set_proxy_basic_auth (const char *username, const char *password)
 
void set_proxy_bearer_token_auth (const char *token)
 
void set_logger (Logger logger)
 

Constructor & Destructor Documentation

◆ Client() [1/4]

httplib::Client::Client ( const char *  scheme_host_port)
explicit

◆ Client() [2/4]

httplib::Client::Client ( const char *  scheme_host_port,
const std::string &  client_cert_path,
const std::string &  client_key_path 
)
explicit

◆ Client() [3/4]

httplib::Client::Client ( const std::string &  host,
int  port 
)
explicit

◆ Client() [4/4]

httplib::Client::Client ( const std::string &  host,
int  port,
const std::string &  client_cert_path,
const std::string &  client_key_path 
)
explicit

◆ ~Client()

httplib::Client::~Client ( )

Member Function Documentation

◆ Delete() [1/6]

Result httplib::Client::Delete ( const char *  path)

◆ Delete() [2/6]

Result httplib::Client::Delete ( const char *  path,
const char *  body,
size_t  content_length,
const char *  content_type 
)

◆ Delete() [3/6]

Result httplib::Client::Delete ( const char *  path,
const Headers headers 
)

◆ Delete() [4/6]

Result httplib::Client::Delete ( const char *  path,
const Headers headers,
const char *  body,
size_t  content_length,
const char *  content_type 
)

◆ Delete() [5/6]

Result httplib::Client::Delete ( const char *  path,
const Headers headers,
const std::string &  body,
const char *  content_type 
)

◆ Delete() [6/6]

Result httplib::Client::Delete ( const char *  path,
const std::string &  body,
const char *  content_type 
)

◆ Get() [1/15]

Result httplib::Client::Get ( const char *  path)

◆ Get() [2/15]

Result httplib::Client::Get ( const char *  path,
const Headers headers 
)

◆ Get() [3/15]

Result httplib::Client::Get ( const char *  path,
const Headers headers,
ContentReceiver  content_receiver 
)

◆ Get() [4/15]

Result httplib::Client::Get ( const char *  path,
const Headers headers,
ContentReceiver  content_receiver,
Progress  progress 
)

◆ Get() [5/15]

Result httplib::Client::Get ( const char *  path,
const Headers headers,
Progress  progress 
)

◆ Get() [6/15]

Result httplib::Client::Get ( const char *  path,
const Headers headers,
ResponseHandler  response_handler,
ContentReceiver  content_receiver 
)

◆ Get() [7/15]

Result httplib::Client::Get ( const char *  path,
const Headers headers,
ResponseHandler  response_handler,
ContentReceiver  content_receiver,
Progress  progress 
)

◆ Get() [8/15]

Result httplib::Client::Get ( const char *  path,
const Params params,
const Headers headers,
ContentReceiver  content_receiver,
Progress  progress = nullptr 
)

◆ Get() [9/15]

Result httplib::Client::Get ( const char *  path,
const Params params,
const Headers headers,
Progress  progress = nullptr 
)

◆ Get() [10/15]

Result httplib::Client::Get ( const char *  path,
const Params params,
const Headers headers,
ResponseHandler  response_handler,
ContentReceiver  content_receiver,
Progress  progress = nullptr 
)

◆ Get() [11/15]

Result httplib::Client::Get ( const char *  path,
ContentReceiver  content_receiver 
)

◆ Get() [12/15]

Result httplib::Client::Get ( const char *  path,
ContentReceiver  content_receiver,
Progress  progress 
)

◆ Get() [13/15]

Result httplib::Client::Get ( const char *  path,
Progress  progress 
)

◆ Get() [14/15]

Result httplib::Client::Get ( const char *  path,
ResponseHandler  response_handler,
ContentReceiver  content_receiver 
)

◆ Get() [15/15]

Result httplib::Client::Get ( const char *  path,
ResponseHandler  response_handler,
ContentReceiver  content_receiver,
Progress  progress 
)

◆ Head() [1/2]

Result httplib::Client::Head ( const char *  path)

◆ Head() [2/2]

Result httplib::Client::Head ( const char *  path,
const Headers headers 
)

◆ is_socket_open()

size_t httplib::Client::is_socket_open ( ) const

◆ is_valid()

bool httplib::Client::is_valid ( ) const

◆ Options() [1/2]

Result httplib::Client::Options ( const char *  path)

◆ Options() [2/2]

Result httplib::Client::Options ( const char *  path,
const Headers headers 
)

◆ Patch() [1/9]

Result httplib::Client::Patch ( const char *  path)

◆ Patch() [2/9]

Result httplib::Client::Patch ( const char *  path,
const char *  body,
size_t  content_length,
const char *  content_type 
)

◆ Patch() [3/9]

Result httplib::Client::Patch ( const char *  path,
const Headers headers,
const char *  body,
size_t  content_length,
const char *  content_type 
)

◆ Patch() [4/9]

Result httplib::Client::Patch ( const char *  path,
const Headers headers,
const std::string &  body,
const char *  content_type 
)

◆ Patch() [5/9]

Result httplib::Client::Patch ( const char *  path,
const Headers headers,
ContentProviderWithoutLength  content_provider,
const char *  content_type 
)

◆ Patch() [6/9]

Result httplib::Client::Patch ( const char *  path,
const Headers headers,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type 
)

◆ Patch() [7/9]

Result httplib::Client::Patch ( const char *  path,
const std::string &  body,
const char *  content_type 
)

◆ Patch() [8/9]

Result httplib::Client::Patch ( const char *  path,
ContentProviderWithoutLength  content_provider,
const char *  content_type 
)

◆ Patch() [9/9]

Result httplib::Client::Patch ( const char *  path,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type 
)

◆ Post() [1/14]

Result httplib::Client::Post ( const char *  path)

◆ Post() [2/14]

Result httplib::Client::Post ( const char *  path,
const char *  body,
size_t  content_length,
const char *  content_type 
)

◆ Post() [3/14]

Result httplib::Client::Post ( const char *  path,
const Headers headers,
const char *  body,
size_t  content_length,
const char *  content_type 
)

◆ Post() [4/14]

Result httplib::Client::Post ( const char *  path,
const Headers headers,
const MultipartFormDataItems items 
)

◆ Post() [5/14]

Result httplib::Client::Post ( const char *  path,
const Headers headers,
const MultipartFormDataItems items,
const std::string &  boundary 
)

◆ Post() [6/14]

Result httplib::Client::Post ( const char *  path,
const Headers headers,
const Params params 
)

◆ Post() [7/14]

Result httplib::Client::Post ( const char *  path,
const Headers headers,
const std::string &  body,
const char *  content_type 
)

◆ Post() [8/14]

Result httplib::Client::Post ( const char *  path,
const Headers headers,
ContentProviderWithoutLength  content_provider,
const char *  content_type 
)

◆ Post() [9/14]

Result httplib::Client::Post ( const char *  path,
const Headers headers,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type 
)

◆ Post() [10/14]

Result httplib::Client::Post ( const char *  path,
const MultipartFormDataItems items 
)

◆ Post() [11/14]

Result httplib::Client::Post ( const char *  path,
const Params params 
)

◆ Post() [12/14]

Result httplib::Client::Post ( const char *  path,
const std::string &  body,
const char *  content_type 
)

◆ Post() [13/14]

Result httplib::Client::Post ( const char *  path,
ContentProviderWithoutLength  content_provider,
const char *  content_type 
)

◆ Post() [14/14]

Result httplib::Client::Post ( const char *  path,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type 
)

◆ Put() [1/11]

Result httplib::Client::Put ( const char *  path)

◆ Put() [2/11]

Result httplib::Client::Put ( const char *  path,
const char *  body,
size_t  content_length,
const char *  content_type 
)

◆ Put() [3/11]

Result httplib::Client::Put ( const char *  path,
const Headers headers,
const char *  body,
size_t  content_length,
const char *  content_type 
)

◆ Put() [4/11]

Result httplib::Client::Put ( const char *  path,
const Headers headers,
const Params params 
)

◆ Put() [5/11]

Result httplib::Client::Put ( const char *  path,
const Headers headers,
const std::string &  body,
const char *  content_type 
)

◆ Put() [6/11]

Result httplib::Client::Put ( const char *  path,
const Headers headers,
ContentProviderWithoutLength  content_provider,
const char *  content_type 
)

◆ Put() [7/11]

Result httplib::Client::Put ( const char *  path,
const Headers headers,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type 
)

◆ Put() [8/11]

Result httplib::Client::Put ( const char *  path,
const Params params 
)

◆ Put() [9/11]

Result httplib::Client::Put ( const char *  path,
const std::string &  body,
const char *  content_type 
)

◆ Put() [10/11]

Result httplib::Client::Put ( const char *  path,
ContentProviderWithoutLength  content_provider,
const char *  content_type 
)

◆ Put() [11/11]

Result httplib::Client::Put ( const char *  path,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type 
)

◆ send() [1/2]

Result httplib::Client::send ( const Request req)

◆ send() [2/2]

bool httplib::Client::send ( Request req,
Response res,
Error error 
)

◆ set_address_family()

void httplib::Client::set_address_family ( int  family)

◆ set_basic_auth()

void httplib::Client::set_basic_auth ( const char *  username,
const char *  password 
)

◆ set_bearer_token_auth()

void httplib::Client::set_bearer_token_auth ( const char *  token)

◆ set_compress()

void httplib::Client::set_compress ( bool  on)

◆ set_connection_timeout() [1/2]

template<class Rep , class Period >
void httplib::Client::set_connection_timeout ( const std::chrono::duration< Rep, Period > &  duration)

◆ set_connection_timeout() [2/2]

void httplib::Client::set_connection_timeout ( time_t  sec,
time_t  usec = 0 
)

◆ set_decompress()

void httplib::Client::set_decompress ( bool  on)

◆ set_default_headers()

void httplib::Client::set_default_headers ( Headers  headers)

◆ set_follow_location()

void httplib::Client::set_follow_location ( bool  on)

◆ set_interface()

void httplib::Client::set_interface ( const char *  intf)

◆ set_keep_alive()

void httplib::Client::set_keep_alive ( bool  on)

◆ set_logger()

void httplib::Client::set_logger ( Logger  logger)

◆ set_proxy()

void httplib::Client::set_proxy ( const char *  host,
int  port 
)

◆ set_proxy_basic_auth()

void httplib::Client::set_proxy_basic_auth ( const char *  username,
const char *  password 
)

◆ set_proxy_bearer_token_auth()

void httplib::Client::set_proxy_bearer_token_auth ( const char *  token)

◆ set_read_timeout() [1/2]

template<class Rep , class Period >
void httplib::Client::set_read_timeout ( const std::chrono::duration< Rep, Period > &  duration)

◆ set_read_timeout() [2/2]

void httplib::Client::set_read_timeout ( time_t  sec,
time_t  usec = 0 
)

◆ set_socket_options()

void httplib::Client::set_socket_options ( SocketOptions  socket_options)

◆ set_tcp_nodelay()

void httplib::Client::set_tcp_nodelay ( bool  on)

◆ set_write_timeout() [1/2]

template<class Rep , class Period >
void httplib::Client::set_write_timeout ( const std::chrono::duration< Rep, Period > &  duration)

◆ set_write_timeout() [2/2]

void httplib::Client::set_write_timeout ( time_t  sec,
time_t  usec = 0 
)

◆ stop()

void httplib::Client::stop ( )
D++ Library version 10.0.35D++ Library version 10.0.34D++ Library version 10.0.33D++ Library version 10.0.32D++ Library version 10.0.31D++ Library version 10.0.30D++ Library version 10.0.29D++ Library version 10.0.28D++ Library version 10.0.27D++ Library version 10.0.26D++ Library version 10.0.25D++ Library version 10.0.24D++ Library version 10.0.23D++ Library version 10.0.22D++ Library version 10.0.21D++ Library version 10.0.20D++ Library version 10.0.19D++ Library version 10.0.18D++ Library version 10.0.17D++ Library version 10.0.16D++ Library version 10.0.15D++ Library version 10.0.14D++ Library version 10.0.13D++ Library version 10.0.12D++ Library version 10.0.11D++ Library version 10.0.10D++ Library version 10.0.9D++ Library version 10.0.8D++ Library version 10.0.7D++ Library version 10.0.6D++ Library version 10.0.5D++ Library version 10.0.4D++ Library version 10.0.3D++ Library version 10.0.2D++ Library version 10.0.1D++ Library version 10.0.0D++ Library version 9.0.19D++ Library version 9.0.18D++ Library version 9.0.17D++ Library version 9.0.16D++ Library version 9.0.15D++ Library version 9.0.14D++ Library version 9.0.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0