kaycxx-http
HTTP client library
Loading...
Searching...
No Matches
url_encoded_form.hpp
1// SPDX-FileCopyrightText: 2026 Klaus Reimer <k@ailis.de>
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include <initializer_list>
7#include <string>
8#include <string_view>
9#include <utility>
10#include <vector>
11
12namespace kaycxx::http {
13
14class client;
15
18public:
20 using field = std::pair<std::string, std::string>;
21
23 url_encoded_form() noexcept;
24
32 url_encoded_form(std::initializer_list<field> fields);
33
40 void add(std::string_view name, std::string_view value);
41
42private:
44 std::vector<field> fields_{};
45
46 friend class client;
47};
48
49} // namespace kaycxx::http
Synchronous HTTP client.
Definition client.hpp:24
void add(std::string_view name, std::string_view value)
Adds a form field.
std::pair< std::string, std::string > field
Form field consisting of a name and value.
Definition url_encoded_form.hpp:20
url_encoded_form() noexcept
Creates an empty URL-encoded form.