12 #include "aegis/config.hpp"
13 #include "aegis/utility.hpp"
14 #include "aegis/error.hpp"
25 using namespace std::chrono_literals;
33 switching_protocols = 101,
38 non_authoritative_information = 203,
41 partial_content = 206,
43 multiple_choices = 300,
44 moved_permanently = 301,
49 temporary_redirect = 307,
53 payment_required = 402,
56 method_not_allowed = 405,
58 proxy_authentication_required = 407,
59 request_timeout = 408,
62 length_required = 411,
63 precondition_failed = 412,
64 request_entity_too_large = 413,
65 request_uri_too_long = 414,
66 unsupported_media_type = 415,
67 request_range_not_satisfiable = 416,
68 expectation_failed = 417,
70 upgrade_required = 426,
71 precondition_required = 428,
72 too_many_requests = 429,
73 request_header_fields_too_large = 431,
75 internal_server_error = 500,
76 not_implemented = 501,
78 service_unavailable = 503,
79 gateway_timeout = 504,
80 http_version_not_supported = 505,
82 network_authentication_required = 511,
88 origin_unreachable = 523,
89 timeout_occurred = 524,
90 ssl_handshake_failed = 525,
91 invalid_ssl_certificate = 526,
101 explicit rest_reply(std::string
const & msg) noexcept
103 , reply_code(http_code::unknown)
104 , execution_time(0ms)
110 , reply_code(http_code::unknown)
111 , execution_time(0ms)
116 rest_reply(http_code reply_code,
bool global, int32_t limit, int32_t remaining, int64_t reset, int32_t retry,
const std::string & content, std::chrono::system_clock::time_point date, std::chrono::steady_clock::duration exec_time = 0ms) noexcept
117 : reply_code(reply_code)
120 , remaining(remaining)
125 , execution_time(exec_time)
129 rest_reply(
const std::string & msg, http_code reply_code = http_code::unknown,
bool global =
false, int32_t limit = 0, int32_t remaining = 0, int64_t reset = 0, int32_t retry = 0,
const std::string & content =
"", std::chrono::steady_clock::duration exec_time = 0ms) noexcept
131 , reply_code(reply_code)
134 , remaining(remaining)
138 , execution_time(exec_time)
148 if (reply_code == http_code::ok || reply_code == http_code::created || reply_code == http_code::accepted || reply_code == http_code::no_content)
157 if (reply_code >= http_code::ok && reply_code <= http_code::partial_content)
169 int32_t remaining = 0;
174 std::chrono::system_clock::time_point
date;
REST responses with error_code for possible exception throwing.
Definition: rest_reply.hpp:98
http_code reply_code
Definition: rest_reply.hpp:166
std::chrono::system_clock::time_point date
Definition: rest_reply.hpp:174
std::chrono::steady_clock::duration execution_time
Definition: rest_reply.hpp:175
std::string content
Definition: rest_reply.hpp:172