Go to the documentation of this file.00001 #ifndef CPR_RESPONSE_H
00002 #define CPR_RESPONSE_H
00003
00004 #include <cstdint>
00005 #include <string>
00006
00007 #include "cookies.h"
00008 #include "cprtypes.h"
00009 #include "defines.h"
00010 #include "error.h"
00011
00012 namespace cpr {
00013 class Response {
00014 public:
00015 Response() = default;
00016
00017 template <typename TextType, typename HeaderType, typename UrlType, typename CookiesType,
00018 typename ErrorType>
00019 Response(const std::int32_t& p_status_code, TextType&& p_text, HeaderType&& p_header, UrlType&& p_url,
00020 const double& p_elapsed, CookiesType&& p_cookies = Cookies{},
00021 ErrorType&& p_error = Error{})
00022 : status_code{p_status_code}, text{CPR_FWD(p_text)}, header{CPR_FWD(p_header)},
00023 url{CPR_FWD(p_url)}, elapsed{p_elapsed}, cookies{CPR_FWD(p_cookies)},
00024 error{CPR_FWD(p_error)} {}
00025
00026 std::int32_t status_code;
00027 std::string text;
00028 Header header;
00029 Url url;
00030 double elapsed;
00031 Cookies cookies;
00032 Error error;
00033 };
00034
00035 }
00036
00037 #endif