userver: userver/clients/http/form.hpp Source File
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
form.hpp
1#pragma once
2
3#include <memory>
4#include <string>
5
6USERVER_NAMESPACE_BEGIN
7
8namespace curl {
9class form;
10} // namespace curl
11
12namespace clients::http {
13
14class Form final {
15 public:
16 Form();
17 ~Form();
18
19 Form(const Form&) = delete;
20 Form(Form&&) = delete;
21 Form& operator=(const Form&) = delete;
22 Form& operator=(Form&&) = delete;
23
24 void AddContent(std::string_view key, std::string_view content);
25 void AddContent(std::string_view key, std::string_view content,
26 const std::string& content_type);
27
28 void AddBuffer(const std::string& key, const std::string& file_name,
29 const std::shared_ptr<std::string>& buffer);
30 void AddBuffer(const std::string& key, const std::string& file_name,
31 const std::shared_ptr<std::string>& buffer,
32 const std::string& content_type);
33
34 const std::shared_ptr<curl::form>& GetNative() const;
35
36 private:
37 std::shared_ptr<curl::form> impl_;
38};
39
40} // namespace clients::http
41
42USERVER_NAMESPACE_END