Cryptolens Client API for C++
RequestHandler_curl.hpp
1 #pragma once
2 
3 #include <string>
4 
5 #include "imports/curl/curl.h"
6 
7 #include "basic_Error.hpp"
8 #include "RequestHandler_v20190401_to_v20180502.hpp"
9 
10 namespace cryptolens_io {
11 
12 namespace v20190401 {
13 
14 namespace errors {
15 
16 namespace RequestHandler_curl {
17 
18 int constexpr CURL_NULL = 1;
19 int constexpr ESCAPE = 2;
20 int constexpr SETOPT_URL = 3;
21 int constexpr SETOPT_WRITEFUNCTION = 4;
22 int constexpr SETOPT_WRITEDATA = 5;
23 int constexpr SETOPT_VERIFYPEER = 6;
24 int constexpr SETOPT_VERIFYHOST = 7;
25 int constexpr PERFORM = 8;
26 int constexpr SETOPT_POSTFIELDS = 9;
27 
28 } // namespace RequestHandler_curl
29 
30 } // namespace errors
31 
33 public:
34  RequestHandler_curl_PostBuilder(CURL * curl, char const* host, char const* endpoint);
35 
37  add_argument(basic_Error & e, char const* key, char const* value);
38 
39  std::string
40  make(basic_Error & e);
41 
42 private:
43  CURL *curl_;
44  char separator_;
45  std::string postfields_;
46  std::string url_;
47 };
48 
59 {
60 public:
61 #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS
62  explicit
63 #endif
65 #ifndef CRYPTOLENS_ENABLE_DANGEROUS_COPY_MOVE_CONSTRUCTOR
68  void operator=(RequestHandler_curl const&) = delete;
69  void operator=(RequestHandler_curl &&) = delete;
70 #endif
72 
74 
76  post_request(basic_Error & e, char const* host, char const* endpoint);
77 private:
78  CURL *curl;
79 };
80 
81 } // namespace v20190401
82 
83 namespace latest {
84 
85 namespace errors {
86 
87 namespace RequestHandler_curl = ::cryptolens_io::v20190401::errors::RequestHandler_curl;
88 
89 } // namespace errors
90 
92 
93 } // namespace latest
94 
95 namespace v20180502 {
96 
97 namespace errors {
98 
99 namespace RequestHandler_curl {
100 
101 int constexpr CURL_NULL = 1;
102 int constexpr ESCAPE = 2;
103 int constexpr SETOPT_URL = 3;
104 int constexpr SETOPT_WRITEFUNCTION = 4;
105 int constexpr SETOPT_WRITEDATA = 5;
106 int constexpr SETOPT_VERIFYPEER = 6;
107 int constexpr SETOPT_VERIFYHOST = 7;
108 int constexpr PERFORM = 8;
109 int constexpr SETOPT_POSTFIELDS = 9;
110 
111 } // namespace RequestHandler_curl
112 
113 } // namespace errors
114 
116 
117 } // namespace v20180502
118 
119 } // namespace cryptolens_io
Definition: RequestHandler_curl.hpp:32
Definition: RequestHandler_curl.hpp:58
Definition: ActivateError.hpp:5
Definition: basic_Error.hpp:90
Definition: RequestHandler_v20190401_to_v20180502.hpp:12
Definition: RequestHandler_curl.hpp:16