1 | #ifndef CPR_RESPONSE_H |
---|---|
2 | #define CPR_RESPONSE_H |
3 | |
4 | #include <cassert> |
5 | #include <cstdint> |
6 | #include <memory> |
7 | #include <string> |
8 | #include <utility> |
9 | #include <vector> |
10 | |
11 | #include "cpr/cert_info.h" |
12 | #include "cpr/cookies.h" |
13 | #include "cpr/cprtypes.h" |
14 | #include "cpr/error.h" |
15 | #include "cpr/ssl_options.h" |
16 | #include "cpr/util.h" |
17 | |
18 | namespace cpr { |
19 | |
20 | class MultiPerform; |
21 | |
22 | class Response { |
23 | private: |
24 | friend MultiPerform; |
25 | std::shared_ptr<CurlHolder> curl_{nullptr}; |
26 | |
27 | public: |
28 | // Ignored here since libcurl uses a long for this. |
29 | // NOLINTNEXTLINE(google-runtime-int) |
30 | long status_code{}; |
31 | std::string text{}; |
32 | Header header{}; |
33 | Url url{}; |
34 | double elapsed{}; |
35 | Cookies cookies{}; |
36 | Error error{}; |
37 | std::string raw_header{}; |
38 | std::string status_line{}; |
39 | std::string reason{}; |
40 | cpr_off_t uploaded_bytes{}; |
41 | cpr_off_t downloaded_bytes{}; |
42 | // Ignored here since libcurl uses a long for this. |
43 | // NOLINTNEXTLINE(google-runtime-int) |
44 | long redirect_count{}; |
45 | |
46 | Response() = default; |
47 | Response(std::shared_ptr<CurlHolder> curl, std::string&& p_text, std::string&& p_header_string, Cookies&& p_cookies, Error&& p_error); |
48 | std::vector<CertInfo> GetCertInfos(); |
49 | Response(const Response& other) = default; |
50 | Response(Response&& old) noexcept = default; |
51 | ~Response() noexcept = default; |
52 | |
53 | Response& operator=(Response&& old) noexcept = default; |
54 | Response& operator=(const Response& other) = default; |
55 | }; |
56 | } // namespace cpr |
57 | |
58 | #endif |
59 |