Darknet/YOLO v3.0-88-gdee7eef
Object Detection Framework
 
Loading...
Searching...
No Matches
httplib::Client Class Reference

#include "httplib.hpp"

Collaboration diagram for httplib::Client:

Public Member Functions

 Client (const char *host, int port=80, time_t timeout_sec=300)
 
virtual ~Client ()
 
std::shared_ptr< ResponseDelete (const char *path)
 
std::shared_ptr< ResponseDelete (const char *path, const Headers &headers)
 
std::shared_ptr< ResponseDelete (const char *path, const Headers &headers, const std::string &body, const char *content_type)
 
std::shared_ptr< ResponseDelete (const char *path, const std::string &body, const char *content_type)
 
void follow_location (bool on)
 
std::shared_ptr< ResponseGet (const char *path)
 
std::shared_ptr< ResponseGet (const char *path, const Headers &headers)
 
std::shared_ptr< ResponseGet (const char *path, const Headers &headers, ContentReceiver content_receiver)
 
std::shared_ptr< ResponseGet (const char *path, const Headers &headers, ContentReceiver content_receiver, Progress progress)
 
std::shared_ptr< ResponseGet (const char *path, const Headers &headers, Progress progress)
 
std::shared_ptr< ResponseGet (const char *path, const Headers &headers, ResponseHandler response_handler, ContentReceiver content_receiver)
 
std::shared_ptr< ResponseGet (const char *path, const Headers &headers, ResponseHandler response_handler, ContentReceiver content_receiver, Progress progress)
 
std::shared_ptr< ResponseGet (const char *path, ContentReceiver content_receiver)
 
std::shared_ptr< ResponseGet (const char *path, ContentReceiver content_receiver, Progress progress)
 
std::shared_ptr< ResponseGet (const char *path, Progress progress)
 
std::shared_ptr< ResponseHead (const char *path)
 
std::shared_ptr< ResponseHead (const char *path, const Headers &headers)
 
virtual bool is_valid () const
 
std::shared_ptr< ResponseOptions (const char *path)
 
std::shared_ptr< ResponseOptions (const char *path, const Headers &headers)
 
std::shared_ptr< ResponsePatch (const char *path, const Headers &headers, const std::string &body, const char *content_type, bool compress=false)
 
std::shared_ptr< ResponsePatch (const char *path, const Headers &headers, size_t content_length, ContentProvider content_provider, const char *content_type, bool compress=false)
 
std::shared_ptr< ResponsePatch (const char *path, const std::string &body, const char *content_type, bool compress=false)
 
std::shared_ptr< ResponsePatch (const char *path, size_t content_length, ContentProvider content_provider, const char *content_type, bool compress=false)
 
std::shared_ptr< ResponsePost (const char *path, const Headers &headers, const MultipartFormDataItems &items, bool compress=false)
 
std::shared_ptr< ResponsePost (const char *path, const Headers &headers, const Params &params, bool compress=false)
 
std::shared_ptr< ResponsePost (const char *path, const Headers &headers, const std::string &body, const char *content_type, bool compress=false)
 
std::shared_ptr< ResponsePost (const char *path, const Headers &headers, size_t content_length, ContentProvider content_provider, const char *content_type, bool compress=false)
 
std::shared_ptr< ResponsePost (const char *path, const MultipartFormDataItems &items, bool compress=false)
 
std::shared_ptr< ResponsePost (const char *path, const Params &params, bool compress=false)
 
std::shared_ptr< ResponsePost (const char *path, const std::string &body, const char *content_type, bool compress=false)
 
std::shared_ptr< ResponsePost (const char *path, size_t content_length, ContentProvider content_provider, const char *content_type, bool compress=false)
 
std::shared_ptr< ResponsePut (const char *path, const Headers &headers, const std::string &body, const char *content_type, bool compress=false)
 
std::shared_ptr< ResponsePut (const char *path, const Headers &headers, size_t content_length, ContentProvider content_provider, const char *content_type, bool compress=false)
 
std::shared_ptr< ResponsePut (const char *path, const std::string &body, const char *content_type, bool compress=false)
 
std::shared_ptr< ResponsePut (const char *path, size_t content_length, ContentProvider content_provider, const char *content_type, bool compress=false)
 
bool send (const Request &req, Response &res)
 
bool send (const std::vector< Request > &requests, std::vector< Response > &responses)
 
void set_keep_alive_max_count (size_t count)
 
void set_read_timeout (time_t sec, time_t usec)
 

Protected Member Functions

bool process_request (Stream &strm, const Request &req, Response &res, bool last_connection, bool &connection_close)
 

Protected Attributes

size_t follow_location_
 
const std::string host_
 
const std::string host_and_port_
 
size_t keep_alive_max_count_
 
const int port_
 
time_t read_timeout_sec_
 
time_t read_timeout_usec_
 
time_t timeout_sec_
 

Private Member Functions

socket_t create_client_socket () const
 
virtual bool is_ssl () const
 
virtual bool process_and_close_socket (socket_t sock, size_t request_count, std::function< bool(Stream &strm, bool last_connection, bool &connection_close)> callback)
 
bool read_response_line (Stream &strm, Response &res)
 
bool redirect (const Request &req, Response &res)
 
std::shared_ptr< Responsesend_with_content_provider (const char *method, const char *path, const Headers &headers, const std::string &body, size_t content_length, ContentProvider content_provider, const char *content_type, bool compress)
 
void write_request (Stream &strm, const Request &req, bool last_connection)
 

Constructor & Destructor Documentation

◆ Client()

httplib::Client::Client ( const char *  host,
int  port = 80,
time_t  timeout_sec = 300 
)
inlineexplicit

◆ ~Client()

httplib::Client::~Client ( )
inlinevirtual

Member Function Documentation

◆ create_client_socket()

socket_t httplib::Client::create_client_socket ( ) const
inlineprivate
Here is the call graph for this function:

◆ Delete() [1/4]

std::shared_ptr< Response > httplib::Client::Delete ( const char *  path)
inline

◆ Delete() [2/4]

std::shared_ptr< Response > httplib::Client::Delete ( const char *  path,
const Headers headers 
)
inline

◆ Delete() [3/4]

std::shared_ptr< Response > httplib::Client::Delete ( const char *  path,
const Headers headers,
const std::string &  body,
const char *  content_type 
)
inline

◆ Delete() [4/4]

std::shared_ptr< Response > httplib::Client::Delete ( const char *  path,
const std::string &  body,
const char *  content_type 
)
inline

◆ follow_location()

void httplib::Client::follow_location ( bool  on)
inline
Here is the caller graph for this function:

◆ Get() [1/10]

std::shared_ptr< Response > httplib::Client::Get ( const char *  path)
inline
Here is the call graph for this function:

◆ Get() [2/10]

std::shared_ptr< Response > httplib::Client::Get ( const char *  path,
const Headers headers 
)
inline
Here is the call graph for this function:

◆ Get() [3/10]

std::shared_ptr< Response > httplib::Client::Get ( const char *  path,
const Headers headers,
ContentReceiver  content_receiver 
)
inline
Here is the call graph for this function:

◆ Get() [4/10]

std::shared_ptr< Response > httplib::Client::Get ( const char *  path,
const Headers headers,
ContentReceiver  content_receiver,
Progress  progress 
)
inline
Here is the call graph for this function:

◆ Get() [5/10]

std::shared_ptr< Response > httplib::Client::Get ( const char *  path,
const Headers headers,
Progress  progress 
)
inline

◆ Get() [6/10]

std::shared_ptr< Response > httplib::Client::Get ( const char *  path,
const Headers headers,
ResponseHandler  response_handler,
ContentReceiver  content_receiver 
)
inline
Here is the call graph for this function:

◆ Get() [7/10]

std::shared_ptr< Response > httplib::Client::Get ( const char *  path,
const Headers headers,
ResponseHandler  response_handler,
ContentReceiver  content_receiver,
Progress  progress 
)
inline

◆ Get() [8/10]

std::shared_ptr< Response > httplib::Client::Get ( const char *  path,
ContentReceiver  content_receiver 
)
inline
Here is the call graph for this function:

◆ Get() [9/10]

std::shared_ptr< Response > httplib::Client::Get ( const char *  path,
ContentReceiver  content_receiver,
Progress  progress 
)
inline
Here is the call graph for this function:

◆ Get() [10/10]

std::shared_ptr< Response > httplib::Client::Get ( const char *  path,
Progress  progress 
)
inline
Here is the call graph for this function:

◆ Head() [1/2]

std::shared_ptr< Response > httplib::Client::Head ( const char *  path)
inline

◆ Head() [2/2]

std::shared_ptr< Response > httplib::Client::Head ( const char *  path,
const Headers headers 
)
inline

◆ is_ssl()

bool httplib::Client::is_ssl ( ) const
inlineprivatevirtual

◆ is_valid()

bool httplib::Client::is_valid ( ) const
inlinevirtual

◆ Options() [1/2]

std::shared_ptr< Response > httplib::Client::Options ( const char *  path)
inline

◆ Options() [2/2]

std::shared_ptr< Response > httplib::Client::Options ( const char *  path,
const Headers headers 
)
inline

◆ Patch() [1/4]

std::shared_ptr< Response > httplib::Client::Patch ( const char *  path,
const Headers headers,
const std::string &  body,
const char *  content_type,
bool  compress = false 
)
inline

◆ Patch() [2/4]

std::shared_ptr< Response > httplib::Client::Patch ( const char *  path,
const Headers headers,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type,
bool  compress = false 
)
inline

◆ Patch() [3/4]

std::shared_ptr< Response > httplib::Client::Patch ( const char *  path,
const std::string &  body,
const char *  content_type,
bool  compress = false 
)
inline

◆ Patch() [4/4]

std::shared_ptr< Response > httplib::Client::Patch ( const char *  path,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type,
bool  compress = false 
)
inline

◆ Post() [1/8]

std::shared_ptr< Response > httplib::Client::Post ( const char *  path,
const Headers headers,
const MultipartFormDataItems items,
bool  compress = false 
)
inline
Here is the call graph for this function:

◆ Post() [2/8]

std::shared_ptr< Response > httplib::Client::Post ( const char *  path,
const Headers headers,
const Params params,
bool  compress = false 
)
inline
Here is the call graph for this function:

◆ Post() [3/8]

std::shared_ptr< Response > httplib::Client::Post ( const char *  path,
const Headers headers,
const std::string &  body,
const char *  content_type,
bool  compress = false 
)
inline

◆ Post() [4/8]

std::shared_ptr< Response > httplib::Client::Post ( const char *  path,
const Headers headers,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type,
bool  compress = false 
)
inline

◆ Post() [5/8]

std::shared_ptr< Response > httplib::Client::Post ( const char *  path,
const MultipartFormDataItems items,
bool  compress = false 
)
inline
Here is the call graph for this function:

◆ Post() [6/8]

std::shared_ptr< Response > httplib::Client::Post ( const char *  path,
const Params params,
bool  compress = false 
)
inline
Here is the call graph for this function:

◆ Post() [7/8]

std::shared_ptr< Response > httplib::Client::Post ( const char *  path,
const std::string &  body,
const char *  content_type,
bool  compress = false 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Post() [8/8]

std::shared_ptr< Response > httplib::Client::Post ( const char *  path,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type,
bool  compress = false 
)
inline
Here is the call graph for this function:

◆ process_and_close_socket()

bool httplib::Client::process_and_close_socket ( socket_t  sock,
size_t  request_count,
std::function< bool(Stream &strm, bool last_connection, bool &connection_close)>  callback 
)
inlineprivatevirtual

◆ process_request()

bool httplib::Client::process_request ( Stream strm,
const Request req,
Response res,
bool  last_connection,
bool &  connection_close 
)
inlineprotected
Here is the call graph for this function:

◆ Put() [1/4]

std::shared_ptr< Response > httplib::Client::Put ( const char *  path,
const Headers headers,
const std::string &  body,
const char *  content_type,
bool  compress = false 
)
inline

◆ Put() [2/4]

std::shared_ptr< Response > httplib::Client::Put ( const char *  path,
const Headers headers,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type,
bool  compress = false 
)
inline

◆ Put() [3/4]

std::shared_ptr< Response > httplib::Client::Put ( const char *  path,
const std::string &  body,
const char *  content_type,
bool  compress = false 
)
inline

◆ Put() [4/4]

std::shared_ptr< Response > httplib::Client::Put ( const char *  path,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type,
bool  compress = false 
)
inline

◆ read_response_line()

bool httplib::Client::read_response_line ( Stream strm,
Response res 
)
inlineprivate
Here is the call graph for this function:

◆ redirect()

bool httplib::Client::redirect ( const Request req,
Response res 
)
inlineprivate
Here is the call graph for this function:

◆ send() [1/2]

bool httplib::Client::send ( const Request req,
Response res 
)
inline

◆ send() [2/2]

bool httplib::Client::send ( const std::vector< Request > &  requests,
std::vector< Response > &  responses 
)
inline

◆ send_with_content_provider()

std::shared_ptr< Response > httplib::Client::send_with_content_provider ( const char *  method,
const char *  path,
const Headers headers,
const std::string &  body,
size_t  content_length,
ContentProvider  content_provider,
const char *  content_type,
bool  compress 
)
inlineprivate

◆ set_keep_alive_max_count()

void httplib::Client::set_keep_alive_max_count ( size_t  count)
inline

◆ set_read_timeout()

void httplib::Client::set_read_timeout ( time_t  sec,
time_t  usec 
)
inline
Here is the call graph for this function:

◆ write_request()

void httplib::Client::write_request ( Stream strm,
const Request req,
bool  last_connection 
)
inlineprivate
Here is the call graph for this function:

Member Data Documentation

◆ follow_location_

size_t httplib::Client::follow_location_
protected

◆ host_

const std::string httplib::Client::host_
protected

◆ host_and_port_

const std::string httplib::Client::host_and_port_
protected

◆ keep_alive_max_count_

size_t httplib::Client::keep_alive_max_count_
protected

◆ port_

const int httplib::Client::port_
protected

◆ read_timeout_sec_

time_t httplib::Client::read_timeout_sec_
protected

◆ read_timeout_usec_

time_t httplib::Client::read_timeout_usec_
protected

◆ timeout_sec_

time_t httplib::Client::timeout_sec_
protected

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