Goby3 3.5.1
2026.06.04
Loading...
Searching...
No Matches
httplib Namespace Reference

Namespaces

namespace  detail

Classes

struct  MultipartFormData
class  DataSink
struct  MultipartFormDataProvider
class  ContentReader
struct  Request
struct  Response
class  Stream
class  TaskQueue
class  ThreadPool
class  Server
class  Result
class  ClientImpl
class  Client

Typedefs

using Headers = std::multimap<std::string, std::string, detail::ci>
using Params = std::multimap<std::string, std::string>
using Match = std::smatch
using Progress = std::function<bool(uint64_t current, uint64_t total)>
using ResponseHandler = std::function<bool(const Response& response)>
using MultipartFormDataItems = std::vector<MultipartFormData>
using MultipartFormDataMap = std::multimap<std::string, MultipartFormData>
using ContentProvider = std::function<bool(size_t offset, size_t length, DataSink& sink)>
using ContentProviderWithoutLength = std::function<bool(size_t offset, DataSink& sink)>
using ContentProviderResourceReleaser = std::function<void(bool success)>
using MultipartFormDataProviderItems = std::vector<MultipartFormDataProvider>
using ContentReceiverWithProgress
using ContentReceiver = std::function<bool(const char* data, size_t data_length)>
using MultipartContentHeader = std::function<bool(const MultipartFormData& file)>
using Range = std::pair<ssize_t, ssize_t>
using Ranges = std::vector<Range>
using Logger = std::function<void(const Request&, const Response&)>
using SocketOptions = std::function<void(socket_t sock)>

Enumerations

enum class  Error {
  Success = 0 , Unknown , Connection , BindIPAddress ,
  Read , Write , ExceedRedirectCount , Canceled ,
  SSLConnection , SSLLoadingCerts , SSLServerVerification , UnsupportedMultipartBoundaryChars ,
  Compression , ConnectionTimeout , ProxyConnection , SSLPeerCouldBeClosed_
}

Functions

void default_socket_options (socket_t sock)
const char * status_message (int status)
std::string to_string (const Error error)
std::ostream & operator<< (std::ostream &os, const Error &obj)
std::string hosted_at (const std::string &hostname)
void hosted_at (const std::string &hostname, std::vector< std::string > &addrs)
std::string append_query_params (const std::string &path, const Params &params)
std::pair< std::string, std::string > make_range_header (Ranges ranges)
std::pair< std::string, std::string > make_basic_authentication_header (const std::string &username, const std::string &password, bool is_proxy=false)
std::pair< std::string, std::string > make_bearer_token_authentication_header (const std::string &token, bool is_proxy=false)

Typedef Documentation

◆ ContentProvider

using httplib::ContentProvider = std::function<bool(size_t offset, size_t length, DataSink& sink)>

Definition at line 424 of file httplib.h.

◆ ContentProviderResourceReleaser

using httplib::ContentProviderResourceReleaser = std::function<void(bool success)>

Definition at line 428 of file httplib.h.

◆ ContentProviderWithoutLength

using httplib::ContentProviderWithoutLength = std::function<bool(size_t offset, DataSink& sink)>

Definition at line 426 of file httplib.h.

◆ ContentReceiver

using httplib::ContentReceiver = std::function<bool(const char* data, size_t data_length)>

Definition at line 442 of file httplib.h.

◆ ContentReceiverWithProgress

Initial value:
std::function<bool(const char* data, size_t data_length,
uint64_t offset, uint64_t total_length)>

Definition at line 439 of file httplib.h.

◆ Headers

using httplib::Headers = std::multimap<std::string, std::string, detail::ci>

Definition at line 369 of file httplib.h.

◆ Logger

using httplib::Logger = std::function<void(const Request&, const Response&)>

Definition at line 689 of file httplib.h.

◆ Match

using httplib::Match = std::smatch

Definition at line 372 of file httplib.h.

◆ MultipartContentHeader

using httplib::MultipartContentHeader = std::function<bool(const MultipartFormData& file)>

Definition at line 444 of file httplib.h.

◆ MultipartFormDataItems

Definition at line 386 of file httplib.h.

◆ MultipartFormDataMap

using httplib::MultipartFormDataMap = std::multimap<std::string, MultipartFormData>

Definition at line 387 of file httplib.h.

◆ MultipartFormDataProviderItems

Definition at line 437 of file httplib.h.

◆ Params

using httplib::Params = std::multimap<std::string, std::string>

Definition at line 371 of file httplib.h.

◆ Progress

using httplib::Progress = std::function<bool(uint64_t current, uint64_t total)>

Definition at line 374 of file httplib.h.

◆ Range

using httplib::Range = std::pair<ssize_t, ssize_t>

Definition at line 469 of file httplib.h.

◆ Ranges

using httplib::Ranges = std::vector<Range>

Definition at line 470 of file httplib.h.

◆ ResponseHandler

using httplib::ResponseHandler = std::function<bool(const Response& response)>

Definition at line 377 of file httplib.h.

◆ SocketOptions

using httplib::SocketOptions = std::function<void(socket_t sock)>

Definition at line 691 of file httplib.h.

Enumeration Type Documentation

◆ Error

enum class httplib::Error
strong
Enumerator
Success 
Unknown 
Connection 
BindIPAddress 
Read 
Write 
ExceedRedirectCount 
Canceled 
SSLConnection 
SSLLoadingCerts 
SSLServerVerification 
UnsupportedMultipartBoundaryChars 
Compression 
ConnectionTimeout 
ProxyConnection 
SSLPeerCouldBeClosed_ 

Definition at line 955 of file httplib.h.

Function Documentation

◆ append_query_params()

std::string httplib::append_query_params ( const std::string & path,
const Params & params )
inline

Definition at line 5696 of file httplib.h.

◆ default_socket_options()

void httplib::default_socket_options ( socket_t sock)
inline

Definition at line 1720 of file httplib.h.

◆ hosted_at() [1/2]

std::string httplib::hosted_at ( const std::string & hostname)
inline

Definition at line 5653 of file httplib.h.

◆ hosted_at() [2/2]

void httplib::hosted_at ( const std::string & hostname,
std::vector< std::string > & addrs )
inline

Definition at line 5664 of file httplib.h.

◆ make_basic_authentication_header()

std::pair< std::string, std::string > httplib::make_basic_authentication_header ( const std::string & username,
const std::string & password,
bool is_proxy = false )
inline

Definition at line 5731 of file httplib.h.

◆ make_bearer_token_authentication_header()

std::pair< std::string, std::string > httplib::make_bearer_token_authentication_header ( const std::string & token,
bool is_proxy = false )
inline

Definition at line 5740 of file httplib.h.

◆ make_range_header()

std::pair< std::string, std::string > httplib::make_range_header ( Ranges ranges)
inline

Definition at line 5706 of file httplib.h.

◆ operator<<()

std::ostream & httplib::operator<< ( std::ostream & os,
const Error & obj )
inline

Definition at line 1858 of file httplib.h.

◆ status_message()

const char * httplib::status_message ( int status)
inline

Definition at line 1736 of file httplib.h.

◆ to_string()

std::string httplib::to_string ( const Error error)
inline

Definition at line 1832 of file httplib.h.