userver: userver/http/parser/http_request_parse_args.hpp Source File
Loading...
Searching...
No Matches
http_request_parse_args.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/http/parser/http_request_parse_args.hpp
4/// @brief Strict URL arguments parsing
5/// @ingroup userver_universal
6
7#include <functional>
8#include <string>
9#include <unordered_map>
10#include <vector>
11
12#include <userver/utils/str_icase.hpp>
13
14USERVER_NAMESPACE_BEGIN
15
16namespace http::parser {
17
18/// Strict URL decoder that throws std::runtime_error on bad input
19std::string UrlDecode(std::string_view url);
20
21void ParseArgs(std::string_view args,
22 std::unordered_map<std::string, std::vector<std::string>,
23 utils::StrCaseHash>& result);
24
25using ArgsConsumer =
26 std::function<void(std::string&& key, std::string&& value)>;
27
28void ParseAndConsumeArgs(std::string_view args, ArgsConsumer handler);
29
30} // namespace http::parser
31
32USERVER_NAMESPACE_END