Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
CPPHTTPLIB_NAMESPACE::Request Struct Reference
Collaboration diagram for CPPHTTPLIB_NAMESPACE::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_ = CPPHTTPLIB_REDIRECT_MAX_COUNT
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_

Member Function Documentation

◆ has_header()

bool CPPHTTPLIB_NAMESPACE::Request::has_header ( const std::string & key) const
inline
288317 {
288318 return detail::has_header(headers, key);
288319}

◆ get_header_value()

std::string CPPHTTPLIB_NAMESPACE::Request::get_header_value ( const std::string & key,
const char * def = "",
size_t id = 0 ) const
inline
288322 {
288323 return detail::get_header_value(headers, key, def, id);
288324}

◆ get_header_value_u64()

size_t CPPHTTPLIB_NAMESPACE::Request::get_header_value_u64 ( const std::string & key,
size_t def = 0,
size_t id = 0 ) const
inline
283594 {
283595 return detail::get_header_value_u64(headers, key, def, id);
283596}

◆ get_header_value_count()

size_t CPPHTTPLIB_NAMESPACE::Request::get_header_value_count ( const std::string & key) const
inline
288326 {
288327 auto r = headers.equal_range(key);
288328 return static_cast<size_t>(std::distance(r.first, r.second));
288329}

◆ set_header()

void CPPHTTPLIB_NAMESPACE::Request::set_header ( const std::string & key,
const std::string & val )
inline
288332 {
288333 if (detail::fields::is_field_name(key) &&
288334 detail::fields::is_field_value(val)) {
288335 headers.emplace(key, val);
288336 }
288337}

◆ has_trailer()

bool CPPHTTPLIB_NAMESPACE::Request::has_trailer ( const std::string & key) const
inline
288339 {
288340 return trailers.find(key) != trailers.end();
288341}

◆ get_trailer_value()

std::string CPPHTTPLIB_NAMESPACE::Request::get_trailer_value ( const std::string & key,
size_t id = 0 ) const
inline
288344 {
288345 auto rng = trailers.equal_range(key);
288346 auto it = rng.first;
288347 std::advance(it, static_cast<ssize_t>(id));
288348 if (it != rng.second) { return it->second; }
288349 return std::string();
288350}

◆ get_trailer_value_count()

size_t CPPHTTPLIB_NAMESPACE::Request::get_trailer_value_count ( const std::string & key) const
inline
288352 {
288353 auto r = trailers.equal_range(key);
288354 return static_cast<size_t>(std::distance(r.first, r.second));
288355}

◆ has_param()

bool CPPHTTPLIB_NAMESPACE::Request::has_param ( const std::string & key) const
inline
288357 {
288358 return params.find(key) != params.end();
288359}

◆ get_param_value()

std::string CPPHTTPLIB_NAMESPACE::Request::get_param_value ( const std::string & key,
size_t id = 0 ) const
inline
288362 {
288363 auto rng = params.equal_range(key);
288364 auto it = rng.first;
288365 std::advance(it, static_cast<ssize_t>(id));
288366 if (it != rng.second) { return it->second; }
288367 return std::string();
288368}

◆ get_param_value_count()

size_t CPPHTTPLIB_NAMESPACE::Request::get_param_value_count ( const std::string & key) const
inline
288370 {
288371 auto r = params.equal_range(key);
288372 return static_cast<size_t>(std::distance(r.first, r.second));
288373}

◆ is_multipart_form_data()

bool CPPHTTPLIB_NAMESPACE::Request::is_multipart_form_data ( ) const
inline
288375 {
288376 const auto &content_type = get_header_value("Content-Type");
288377 return !content_type.rfind("multipart/form-data", 0);
288378}

Member Data Documentation

◆ is_connection_closed

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

◆ start_time_

std::chrono::time_point<std::chrono::steady_clock> CPPHTTPLIB_NAMESPACE::Request::start_time_
Initial value:
=
(std::chrono::steady_clock::time_point::min)()

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