URL manipulation functions.
Definition in file url.hpp.
Go to the source code of this file.
#include <map>
#include <optional>
#include <string>
#include <string_view>
#include <unordered_map>
#include <userver/utils/impl/internal_tag_fwd.hpp>
#include <userver/utils/str_icase.hpp>
Namespaces | |
namespace | http |
HTTP helpers. | |
Typedefs | |
using | http::Args = std::unordered_map<std::string, std::string, utils::StrCaseHash> |
using | http::MultiArgs = std::multimap<std::string, std::string> |
using | http::PathArgs = std::unordered_map<std::string, std::string> |
Functions | |
std::string | http::UrlDecode (std::string_view range) |
Decode URL. | |
std::string | http::UrlEncode (std::string_view input_string) |
Encode as URL. | |
std::string | http::MakeQuery (const Args &query_args) |
Make an URL query. | |
std::string | http::MakeQuery (const MultiArgs &query_args) |
Make an URL query. | |
std::string | http::MakeQuery (const std::unordered_map< std::string, std::string > &query_args) |
Make an URL query. | |
std::string | http::MakeQuery (std::initializer_list< std::pair< std::string_view, std::string_view > > query_args) |
Make an URL query. | |
std::string | http::MakeUrl (std::string_view path, const Args &query_args) |
Make an URL with query arguments. | |
std::string | http::MakeUrl (std::string_view path, const std::unordered_map< std::string, std::string > &query_args) |
Make an URL with query arguments. | |
std::string | http::MakeUrl (std::string_view path, const Args &query_args, MultiArgs query_multiargs) |
Make an URL with query arguments. | |
std::string | http::MakeUrl (std::string_view path, std::initializer_list< std::pair< std::string_view, std::string_view > > query_args) |
Make an URL with query arguments. | |
std::optional< std::string > | http::MakeUrlWithPathArgs (std::string_view path, const PathArgs &path_args) |
Make a path from a template and arguments. | |
std::optional< std::string > | http::MakeUrlWithPathArgs (std::string_view path, const PathArgs &path_args, const Args &query_args) |
Make an URL with path parameters and query arguments. | |
std::optional< std::string > | http::MakeUrlWithPathArgs (std::string_view path, const PathArgs &path_args, const std::unordered_map< std::string, std::string > &query_args) |
Make an URL with path parameters and query arguments. | |
std::optional< std::string > | http::MakeUrlWithPathArgs (std::string_view path, const PathArgs &path_args, const Args &query_args, MultiArgs query_multiargs) |
Make an URL with path parameters and query arguments, supporting multiple values for the same key. | |
std::optional< std::string > | http::MakeUrlWithPathArgs (std::string_view path, const PathArgs &path_args, std::initializer_list< std::pair< std::string_view, std::string_view > > query_args) |
Make an URL with path parameters and query arguments. | |
std::string | http::ExtractMetaTypeFromUrl (const std::string &url) |
Returns URL part before the first '?' character. | |
std::string | http::ExtractPath (std::string_view url) |
Returns HTTP path part of a URL. | |
std::string | http::ExtractHostname (std::string_view url) |
Returns hostname part of a URL. | |