D++ (DPP)
C++ Discord API Bot Library
httplib::Response Struct Reference

#include <httplib.h>

+ Collaboration diagram for httplib::Response:

Public Member Functions

bool has_header (const char *key) const
 
std::string get_header_value (const char *key, size_t id=0) const
 
template<typename T >
get_header_value (const char *key, size_t id=0) const
 
size_t get_header_value_count (const char *key) const
 
void set_header (const char *key, const char *val)
 
void set_header (const char *key, const std::string &val)
 
void set_redirect (const char *url, int status=302)
 
void set_redirect (const std::string &url, int status=302)
 
void set_content (const char *s, size_t n, const char *content_type)
 
void set_content (const std::string &s, const char *content_type)
 
void set_content_provider (size_t length, const char *content_type, ContentProvider provider, const std::function< void()> &resource_releaser=nullptr)
 
void set_content_provider (const char *content_type, ContentProviderWithoutLength provider, const std::function< void()> &resource_releaser=nullptr)
 
void set_chunked_content_provider (const char *content_type, ContentProviderWithoutLength provider, const std::function< void()> &resource_releaser=nullptr)
 
 Response ()=default
 
 Response (const Response &)=default
 
Responseoperator= (const Response &)=default
 
 Response (Response &&)=default
 
Responseoperator= (Response &&)=default
 
 ~Response ()
 

Public Attributes

std::string version
 
int status = -1
 
std::string reason
 
Headers headers
 
std::string body
 
std::string location
 
size_t content_length_ = 0
 
ContentProvider content_provider_
 
std::function< void()> content_provider_resource_releaser_
 
bool is_chunked_content_provider_ = false
 

Constructor & Destructor Documentation

◆ Response() [1/3]

httplib::Response::Response ( )
default

◆ Response() [2/3]

httplib::Response::Response ( const Response )
default

◆ Response() [3/3]

httplib::Response::Response ( Response &&  )
default

◆ ~Response()

httplib::Response::~Response ( )
inline

Member Function Documentation

◆ get_header_value() [1/2]

std::string httplib::Response::get_header_value ( const char *  key,
size_t  id = 0 
) const

◆ get_header_value() [2/2]

template<typename T >
T httplib::Response::get_header_value ( const char *  key,
size_t  id = 0 
) const

◆ get_header_value_count()

size_t httplib::Response::get_header_value_count ( const char *  key) const

◆ has_header()

bool httplib::Response::has_header ( const char *  key) const

◆ operator=() [1/2]

Response & httplib::Response::operator= ( const Response )
default

◆ operator=() [2/2]

Response & httplib::Response::operator= ( Response &&  )
default

◆ set_chunked_content_provider()

void httplib::Response::set_chunked_content_provider ( const char *  content_type,
ContentProviderWithoutLength  provider,
const std::function< void()> &  resource_releaser = nullptr 
)

◆ set_content() [1/2]

void httplib::Response::set_content ( const char *  s,
size_t  n,
const char *  content_type 
)

◆ set_content() [2/2]

void httplib::Response::set_content ( const std::string &  s,
const char *  content_type 
)

◆ set_content_provider() [1/2]

void httplib::Response::set_content_provider ( const char *  content_type,
ContentProviderWithoutLength  provider,
const std::function< void()> &  resource_releaser = nullptr 
)

◆ set_content_provider() [2/2]

void httplib::Response::set_content_provider ( size_t  length,
const char *  content_type,
ContentProvider  provider,
const std::function< void()> &  resource_releaser = nullptr 
)

◆ set_header() [1/2]

void httplib::Response::set_header ( const char *  key,
const char *  val 
)

◆ set_header() [2/2]

void httplib::Response::set_header ( const char *  key,
const std::string &  val 
)

◆ set_redirect() [1/2]

void httplib::Response::set_redirect ( const char *  url,
int  status = 302 
)

◆ set_redirect() [2/2]

void httplib::Response::set_redirect ( const std::string &  url,
int  status = 302 
)

Member Data Documentation

◆ body

std::string httplib::Response::body

◆ content_length_

size_t httplib::Response::content_length_ = 0

◆ content_provider_

ContentProvider httplib::Response::content_provider_

◆ content_provider_resource_releaser_

std::function<void()> httplib::Response::content_provider_resource_releaser_

◆ headers

Headers httplib::Response::headers

◆ is_chunked_content_provider_

bool httplib::Response::is_chunked_content_provider_ = false

◆ location

std::string httplib::Response::location

◆ reason

std::string httplib::Response::reason

◆ status

int httplib::Response::status = -1

◆ version

std::string httplib::Response::version
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