Cryptolens Client API for C++
RequestHandler_WinHTTP.hpp
1 #pragma once
2 
3 #include <string>
4 
5 #include "imports/windows/Windows.h"
6 #include "imports/windows/winhttp.h"
7 
8 #include "api.hpp"
9 #include "basic_Error.hpp"
10 #include "RequestHandler_v20190401_to_v20180502.hpp"
11 
12 namespace cryptolens_io {
13 
14 namespace v20190401 {
15 
16 namespace errors {
17 
18 namespace RequestHandler_WinHTTP {
19 
20 int constexpr WINHTTP_OPEN_FAILED = 1;
21 int constexpr WINHTTP_CONNECT_FAILED = 2;
22 int constexpr WINHTTP_OPEN_REQUEST_FAILED = 3;
23 int constexpr WINHTTP_SEND_REQUEST_FAILED = 4;
24 int constexpr WINHTTP_RECIEVE_RESPONSE_FAILED = 5;
25 int constexpr WINHTTP_QUERY_DATA_AVAILABLE_FAILED = 6;
26 int constexpr WINHTTP_READ_DATA_FAILED = 7;
27 int constexpr WINHTTP_POSTFIELDS_TOO_LARGE = 8;
28 int constexpr MULTIBYTETOWIDE_ENDPOINT = 9;
29 int constexpr MULTIBYTETOWIDE_HOST = 10;
30 
31 } // namespace RequestHandler_WinHTTP
32 
33 } // namespace errors
34 
36 public:
37  RequestHandler_WinHTTP_PostBuilder(char const* host, char const* endpoint);
38 
40  add_argument(basic_Error & e, char const* key, char const* value);
41 
42  std::string
43  make(basic_Error & e);
44 
45 private:
46  char separator_;
47  std::string postfields_;
48  char const* host_;
49  char const* endpoint_;
50 };
51 
62 {
63 public:
64 #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS
65  explicit
66 #endif
68 #ifndef CRYPTOLENS_ENABLE_DANGEROUS_COPY_MOVE_CONSTRUCTOR
71  void operator=(RequestHandler_WinHTTP const&) = delete;
72  void operator=(RequestHandler_WinHTTP &&) = delete;
73 #endif
75 
77 
79  post_request(basic_Error& e, char const* host, char const* endpoint);
80 };
81 
82 } // namespace v20190401
83 
84 namespace latest {
85 
86 namespace errors {
87 
88 namespace RequestHandler_WinHTTP = ::cryptolens_io::v20190401::errors::RequestHandler_WinHTTP;
89 
90 } // namespace errors
91 
93 
94 } // namespace latest
95 
96 namespace v20180502 {
97 
98 namespace errors {
99 
100 namespace RequestHandler_WinHTTP = ::cryptolens_io::v20190401::errors::RequestHandler_WinHTTP;
101 
102 } // namespace errors
103 
105 
106 } // namespace v20180502
107 
108 } // namespace cryptolens_io
Definition: RequestHandler_WinHTTP.hpp:61
Definition: RequestHandler_WinHTTP.hpp:18
Definition: ActivateError.hpp:5
Definition: basic_Error.hpp:90
Definition: RequestHandler_v20190401_to_v20180502.hpp:12
Definition: RequestHandler_WinHTTP.hpp:35