|
Botan 3.13.0
Crypto and TLS for C&
|
Classes | |
| struct | Case_Insensitive_Less |
| class | HTTP_Error |
| class | RequestLimits |
| class | Response |
Typedefs | |
| using | Headers = std::map<std::string, std::string, Case_Insensitive_Less> |
| typedef std::function< Response(std::string_view, std::string_view, std::string_view, std::optional< size_t >)> | http_exch_fn |
Functions | |
| Response | GET_sync (const URI &uri, const RequestLimits &limits) |
| Response | http_sync (const http_exch_fn &http_transact, std::string_view verb, const URI &uri, std::string_view content_type, const std::vector< uint8_t > &body, const RequestLimits &limits) |
| Response | http_sync (std::string_view verb, const URI &uri, std::string_view content_type, const std::vector< uint8_t > &body, const RequestLimits &limits) |
| std::ostream & | operator<< (std::ostream &o, const Response &resp) |
| Response | POST_sync (const URI &uri, std::string_view content_type, const std::vector< uint8_t > &body, const RequestLimits &limits) |
| Response | read_response_from_socket (OS::Socket &socket, std::chrono::milliseconds timeout, std::optional< size_t > max_body_size) |
| std::string | url_encode (std::string_view in) |
| using Botan::HTTP::Headers = std::map<std::string, std::string, Case_Insensitive_Less> |
Definition at line 61 of file http_util.h.
| typedef std::function<Response(std::string_view, std::string_view, std::string_view, std::optional<size_t>)> Botan::HTTP::http_exch_fn |
Definition at line 131 of file http_util.h.
| Response BOTAN_TEST_API Botan::HTTP::GET_sync | ( | const URI & | uri, |
| const RequestLimits & | limits ) |
Definition at line 399 of file http_util.cpp.
References http_sync().
| Response BOTAN_TEST_API Botan::HTTP::http_sync | ( | const http_exch_fn & | http_transact, |
| std::string_view | verb, | ||
| const URI & | uri, | ||
| std::string_view | content_type, | ||
| const std::vector< uint8_t > & | body, | ||
| const RequestLimits & | limits ) |
Definition at line 296 of file http_util.cpp.
References Botan::URI::authority(), Botan::cast_uint8_ptr_to_char(), Botan::fmt(), Botan::HTTP::Response::headers(), http_sync(), Botan::HTTP::RequestLimits::max_body_size(), Botan::HTTP::RequestLimits::max_redirects(), Botan::URI::path(), Botan::URI::query(), Botan::URI::scheme(), Botan::HTTP::RequestLimits::set_max_redirects(), and Botan::HTTP::Response::status_code().
Referenced by GET_sync(), http_sync(), http_sync(), and POST_sync().
| Response Botan::HTTP::http_sync | ( | std::string_view | verb, |
| const URI & | uri, | ||
| std::string_view | content_type, | ||
| const std::vector< uint8_t > & | body, | ||
| const RequestLimits & | limits ) |
Definition at line 385 of file http_util.cpp.
References http_sync(), and Botan::HTTP::RequestLimits::timeout().
| BOTAN_TEST_API std::ostream & Botan::HTTP::operator<< | ( | std::ostream & | o, |
| const Response & | resp ) |
Definition at line 286 of file http_util.cpp.
References Botan::HTTP::Response::body(), Botan::cast_uint8_ptr_to_char(), Botan::HTTP::Response::headers(), Botan::HTTP::Response::status_code(), and Botan::HTTP::Response::status_message().
| Response Botan::HTTP::POST_sync | ( | const URI & | uri, |
| std::string_view | content_type, | ||
| const std::vector< uint8_t > & | body, | ||
| const RequestLimits & | limits ) |
Definition at line 403 of file http_util.cpp.
References http_sync().
| Response BOTAN_TEST_API Botan::HTTP::read_response_from_socket | ( | OS::Socket & | socket, |
| std::chrono::milliseconds | timeout, | ||
| std::optional< size_t > | max_body_size ) |
Read a complete HTTP/1.0 response from an already-connected socket and return the parsed Response. Enforces header- and body-size limits during the read. Exposed via BOTAN_TEST_API so the parser can be exercised against a fake socket; production code reaches it through http_transact.
Definition at line 190 of file http_util.cpp.
References Botan::cast_uint8_ptr_to_char(), Botan::DefaultBufferSize, Botan::fmt(), and Botan::OS::Socket::read().
| std::string BOTAN_TEST_API Botan::HTTP::url_encode | ( | std::string_view | in | ) |
Definition at line 267 of file http_util.cpp.
References Botan::CharacterValidityTable::alpha_numeric_plus(), and Botan::CharacterValidityTable::invert().