maph 1.0.0 High-Performance Memory-Mapped Key-Value Database with O(1) Lookups

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
httplib::Request Struct Reference

`#include <httplib.h>`

Collaboration diagram for httplib::Request:

## Public Member Functions
bool | has_header (const std::string &key) const
std::string | get_header_value (const std::string &key, const char *def="", size_t id=0) const
size_t | get_header_value_u64 (const std::string &key, size_t def=0, size_t id=0) const
size_t | get_header_value_count (const std::string &key) const
void | set_header (const std::string &key, const std::string &val)
bool | has_trailer (const std::string &key) const
std::string | get_trailer_value (const std::string &key, size_t id=0) const
size_t | get_trailer_value_count (const std::string &key) const
bool | has_param (const std::string &key) const
std::string | get_param_value (const std::string &key, size_t id=0) const
size_t | get_param_value_count (const std::string &key) const
bool | is_multipart_form_data () const

## Public Attributes
std::string | method
std::string | path
std::string | matched_route
Params | params
Headers | headers
Headers | trailers
std::string | body
std::string | remote_addr
int | remote_port = -1
std::string | local_addr
int | local_port = -1
std::string | version
std::string | target
MultipartFormData | form
Ranges | ranges
Match | matches
std::unordered_map< std::string, std::string > | path_params
std::function< bool()> | is_connection_closed = []() { return true; }
std::vector< std::string > | accept_content_types
ResponseHandler | response_handler
ContentReceiverWithProgress | content_receiver
DownloadProgress | download_progress
UploadProgress | upload_progress
size_t | redirect_count_ = 20
size_t | content_length_ = 0
ContentProvider | content_provider_
bool | is_chunked_content_provider_ = false
size_t | authorization_count_ = 0
std::chrono::time_point< std::chrono::steady_clock > | start_time_

## Detailed Description

Definition at line 716 of file httplib.h.

## Member Function Documentation

## ◆ get_header_value()

std::string httplib::Request::get_header_value | ( | const std::string & | key,
|  | const char * | def = `""`,
|  | size_t | id = `0`
| ) |  | const
| inline

Definition at line 6736 of file httplib.h.

Referenced by httplib::get_bearer_token_auth(), and httplib::Server::process_request().

Here is the caller graph for this function:

## ◆ get_header_value_count()

size_t httplib::Request::get_header_value_count | ( | const std::string & | key | ) | const
| inline

Definition at line 6741 of file httplib.h.

## ◆ get_header_value_u64()

size_t httplib::Request::get_header_value_u64 | ( | const std::string & | key,
|  | size_t | def = `0`,
|  | size_t | id = `0`
| ) |  | const
| inline

Definition at line 2079 of file httplib.h.

References headers.

## ◆ get_param_value()

std::string httplib::Request::get_param_value | ( | const std::string & | key,
|  | size_t | id = `0`
| ) |  | const
| inline

Definition at line 6776 of file httplib.h.

## ◆ get_param_value_count()

size_t httplib::Request::get_param_value_count | ( | const std::string & | key | ) | const
| inline

Definition at line 6785 of file httplib.h.

## ◆ get_trailer_value()

std::string httplib::Request::get_trailer_value | ( | const std::string & | key,
|  | size_t | id = `0`
| ) |  | const
| inline

Definition at line 6758 of file httplib.h.

## ◆ get_trailer_value_count()

size_t httplib::Request::get_trailer_value_count | ( | const std::string & | key | ) | const
| inline

Definition at line 6767 of file httplib.h.

## ◆ has_header()

bool httplib::Request::has_header | ( | const std::string & | key | ) | const
| inline

Definition at line 6732 of file httplib.h.

Referenced by httplib::get_bearer_token_auth(), and httplib::Server::process_request().

Here is the caller graph for this function:

## ◆ has_param()

bool httplib::Request::has_param | ( | const std::string & | key | ) | const
| inline

Definition at line 6772 of file httplib.h.

## ◆ has_trailer()

bool httplib::Request::has_trailer | ( | const std::string & | key | ) | const
| inline

Definition at line 6754 of file httplib.h.

## ◆ is_multipart_form_data()

bool httplib::Request::is_multipart_form_data | ( |  | ) | const
| inline

Definition at line 6790 of file httplib.h.

## ◆ set_header()

void httplib::Request::set_header | ( | const std::string & | key,
|  | const std::string & | val
| ) |  |
| inline

Definition at line 6746 of file httplib.h.

Referenced by httplib::ClientImpl::Delete(), httplib::ClientImpl::Patch(), httplib::ClientImpl::Post(), httplib::Server::process_request(), and httplib::ClientImpl::Put().

Here is the caller graph for this function:

## Member Data Documentation

## ◆ accept_content_types

std::vector<std::string> httplib::Request::accept_content_types

Definition at line 740 of file httplib.h.

Referenced by httplib::Server::process_request().

## ◆ authorization_count_

size_t httplib::Request::authorization_count_ = 0

Definition at line 772 of file httplib.h.

## ◆ body

std::string httplib::Request::body

Definition at line 723 of file httplib.h.

Referenced by httplib::ClientImpl::Delete(), main(), httplib::ClientImpl::Patch(), httplib::ClientImpl::Post(), and httplib::ClientImpl::Put().

## ◆ content_length_

size_t httplib::Request::content_length_ = 0

Definition at line 769 of file httplib.h.

Referenced by httplib::ClientImpl::write_content_with_provider().

## ◆ content_provider_

ContentProvider httplib::Request::content_provider_

Definition at line 770 of file httplib.h.

Referenced by httplib::ClientImpl::write_content_with_provider().

## ◆ content_receiver

ContentReceiverWithProgress httplib::Request::content_receiver

Definition at line 742 of file httplib.h.

Referenced by httplib::ClientImpl::Get(), httplib::ClientImpl::Patch(), httplib::ClientImpl::Post(), httplib::ClientImpl::process_request(), and httplib::ClientImpl::Put().

## ◆ download_progress

DownloadProgress httplib::Request::download_progress

Definition at line 743 of file httplib.h.

Referenced by httplib::ClientImpl::Delete(), httplib::ClientImpl::Get(), httplib::ClientImpl::Get(), httplib::ClientImpl::Patch(), httplib::ClientImpl::Post(), httplib::ClientImpl::process_request(), and httplib::ClientImpl::Put().

## ◆ form

MultipartFormData httplib::Request::form

Definition at line 733 of file httplib.h.

## ◆ headers

Headers httplib::Request::headers

Definition at line 721 of file httplib.h.

Referenced by httplib::ClientImpl::Delete(), httplib::ClientImpl::Get(), httplib::ClientImpl::Get(), get_header_value_u64(), httplib::ClientImpl::Head(), httplib::ClientImpl::Options(), httplib::ClientImpl::Patch(), httplib::ClientImpl::Post(), httplib::Server::process_request(), and httplib::ClientImpl::Put().

## ◆ is_chunked_content_provider_

bool httplib::Request::is_chunked_content_provider_ = false

Definition at line 771 of file httplib.h.

Referenced by httplib::ClientImpl::write_content_with_provider().

## ◆ is_connection_closed

std::function<bool()> httplib::Request::is_connection_closed = []() { return true; }

Definition at line 737 of file httplib.h.

Referenced by httplib::Server::process_request().

## ◆ local_addr

std::string httplib::Request::local_addr

Definition at line 727 of file httplib.h.

Referenced by httplib::Server::process_request().

## ◆ local_port

int httplib::Request::local_port = -1

Definition at line 728 of file httplib.h.

Referenced by httplib::Server::process_request().

## ◆ matched_route

std::string httplib::Request::matched_route

Definition at line 719 of file httplib.h.

## ◆ matches

Match httplib::Request::matches

Definition at line 735 of file httplib.h.

Referenced by main(), httplib::detail::PathParamsMatcher::match(), and httplib::detail::RegexMatcher::match().

## ◆ method

std::string httplib::Request::method

Definition at line 717 of file httplib.h.

Referenced by httplib::ClientImpl::Delete(), httplib::ClientImpl::Get(), httplib::ClientImpl::Get(), httplib::ClientImpl::Head(), httplib::ClientImpl::Options(), httplib::ClientImpl::Patch(), httplib::ClientImpl::Post(), httplib::ClientImpl::process_request(), and httplib::ClientImpl::Put().

## ◆ params

Params httplib::Request::params

Definition at line 720 of file httplib.h.

## ◆ path

std::string httplib::Request::path

Definition at line 718 of file httplib.h.

Referenced by httplib::ClientImpl::Delete(), httplib::ClientImpl::Get(), httplib::ClientImpl::Get(), httplib::ClientImpl::Head(), httplib::detail::PathParamsMatcher::match(), httplib::detail::RegexMatcher::match(), httplib::ClientImpl::Options(), httplib::ClientImpl::Patch(), httplib::ClientImpl::Post(), and httplib::ClientImpl::Put().

## ◆ path_params

std::unordered_map<std::string, std::string> httplib::Request::path_params

Definition at line 736 of file httplib.h.

Referenced by httplib::detail::PathParamsMatcher::match(), and httplib::detail::RegexMatcher::match().

## ◆ ranges

Ranges httplib::Request::ranges

Definition at line 734 of file httplib.h.

Referenced by httplib::Server::process_request().

## ◆ redirect_count_

size_t httplib::Request::redirect_count_ = 20

Definition at line 768 of file httplib.h.

## ◆ remote_addr

std::string httplib::Request::remote_addr

Definition at line 725 of file httplib.h.

Referenced by httplib::Server::process_request().

## ◆ remote_port

int httplib::Request::remote_port = -1

Definition at line 726 of file httplib.h.

Referenced by httplib::Server::process_request().

## ◆ response_handler

ResponseHandler httplib::Request::response_handler

Definition at line 741 of file httplib.h.

Referenced by httplib::ClientImpl::Get(), and httplib::ClientImpl::process_request().

## ◆ start_time_

std::chrono::time_point<std::chrono::steady_clock> httplib::Request::start_time_

Initial value:
=
(std::chrono::steady_clock::time_point::min)()

Definition at line 773 of file httplib.h.

Referenced by httplib::ClientImpl::Delete(), httplib::ClientImpl::Get(), httplib::ClientImpl::Get(), httplib::ClientImpl::Head(), httplib::ClientImpl::Options(), httplib::ClientImpl::Patch(), httplib::ClientImpl::Post(), httplib::Server::process_request(), and httplib::ClientImpl::Put().

## ◆ target

std::string httplib::Request::target

Definition at line 732 of file httplib.h.

Referenced by httplib::Server::process_request().

## ◆ trailers

Headers httplib::Request::trailers

Definition at line 722 of file httplib.h.

## ◆ upload_progress

UploadProgress httplib::Request::upload_progress

Definition at line 744 of file httplib.h.

Referenced by httplib::ClientImpl::write_content_with_provider().

## ◆ version

std::string httplib::Request::version

Definition at line 731 of file httplib.h.

Referenced by httplib::Server::process_request().

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

- integrations/rest_api/httplib.h