status_codes.h
Go to the documentation of this file.
1 #ifndef _CPR_STATUS_CODES
2 #define _CPR_STATUS_CODES
3 #include <cstdint>
4 namespace cpr {
5 namespace status {
6 // Information responses
7 constexpr std::int32_t HTTP_CONTINUE = 100;
8 constexpr std::int32_t HTTP_SWITCHING_PROTOCOL = 101;
9 constexpr std::int32_t HTTP_PROCESSING = 102;
10 constexpr std::int32_t HTTP_EARLY_HINTS = 103;
11 // Sucessful responses
12 constexpr std::int32_t HTTP_OK = 200;
13 constexpr std::int32_t HTTP_CREATED = 201;
14 constexpr std::int32_t HTTP_ACCEPTED = 202;
15 constexpr std::int32_t HTTP_NON_AUTHORITATIVE_INFORMATION = 203;
16 constexpr std::int32_t HTTP_NO_CONTENT = 204;
17 constexpr std::int32_t HTTP_RESET_CONTENT = 205;
18 constexpr std::int32_t HTTP_PARTIAL_CONTENT = 206;
19 constexpr std::int32_t HTTP_MULTI_STATUS = 207;
20 constexpr std::int32_t HTTP_ALREADY_REPORTED = 208;
21 constexpr std::int32_t HTTP_IM_USED = 226;
22 // Redirection messages
23 constexpr std::int32_t HTTP_MULTIPLE_CHOICE = 300;
24 constexpr std::int32_t HTTP_MOVED_PERMANENTLY = 301;
25 constexpr std::int32_t HTTP_FOUND = 302;
26 constexpr std::int32_t HTTP_SEE_OTHER = 303;
27 constexpr std::int32_t HTTP_NOT_MODIFIED = 304;
28 constexpr std::int32_t HTTP_USE_PROXY = 305;
29 constexpr std::int32_t HTTP_UNUSED = 306;
30 constexpr std::int32_t HTTP_TEMPORARY_REDIRECT = 307;
31 constexpr std::int32_t HTTP_PERMANENT_REDIRECT = 308;
32 // Client error responses
33 constexpr std::int32_t HTTP_BAD_REQUEST = 400;
34 constexpr std::int32_t HTTP_UNAUTHORIZED = 401;
35 constexpr std::int32_t HTTP_PAYMENT_REQUIRED = 402;
36 constexpr std::int32_t HTTP_FORBIDDEN = 403;
37 constexpr std::int32_t HTTP_NOT_FOUND = 404;
38 constexpr std::int32_t HTTP_METHOD_NOT_ALLOWED = 405;
39 constexpr std::int32_t HTTP_NOT_ACCEPTABLE = 406;
40 constexpr std::int32_t HTTP_PROXY_AUTHENTICATION_REQUIRED = 407;
41 constexpr std::int32_t HTTP_REQUEST_TIMEOUT = 408;
42 constexpr std::int32_t HTTP_CONFLICT = 409;
43 constexpr std::int32_t HTTP_GONE = 410;
44 constexpr std::int32_t HTTP_LENGTH_REQUIRED = 411;
45 constexpr std::int32_t HTTP_PRECONDITION_FAILED = 412;
46 constexpr std::int32_t HTTP_PAYLOAD_TOO_LARGE = 413;
47 constexpr std::int32_t HTTP_URI_TOO_LONG = 414;
48 constexpr std::int32_t HTTP_UNSUPPORTED_MEDIA_TYPE = 415;
49 constexpr std::int32_t HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
50 constexpr std::int32_t HTTP_EXPECTATION_FAILED = 417;
51 constexpr std::int32_t HTTP_IM_A_TEAPOT = 418;
52 constexpr std::int32_t HTTP_MISDIRECTED_REQUEST = 421;
53 constexpr std::int32_t HTTP_UNPROCESSABLE_ENTITY = 422;
54 constexpr std::int32_t HTTP_LOCKED = 423;
55 constexpr std::int32_t HTTP_FAILED_DEPENDENCY = 424;
56 constexpr std::int32_t HTTP_TOO_EARLY = 425;
57 constexpr std::int32_t HTTP_UPGRADE_REQUIRED = 426;
58 constexpr std::int32_t HTTP_PRECONDITION_REQUIRED = 428;
59 constexpr std::int32_t HTTP_TOO_MANY_REQUESTS = 429;
60 constexpr std::int32_t HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431;
61 constexpr std::int32_t HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451;
62 // Server response errors
63 constexpr std::int32_t HTTP_INTERNAL_SERVER_ERROR = 500;
64 constexpr std::int32_t HTTP_NOT_IMPLEMENTED = 501;
65 constexpr std::int32_t HTTP_BAD_GATEWAY = 502;
66 constexpr std::int32_t HTTP_SERVICE_UNAVAILABLE = 503;
67 constexpr std::int32_t HTTP_GATEWAY_TIMEOUT = 504;
68 constexpr std::int32_t HTTP_HTTP_VERSION_NOT_SUPPORTED = 505;
69 constexpr std::int32_t HTTP_VARIANT_ALSO_NEGOTIATES = 506;
70 constexpr std::int32_t HTTP_INSUFFICIENT_STORAGE = 507;
71 constexpr std::int32_t HTTP_LOOP_DETECTED = 508;
72 constexpr std::int32_t HTTP_NOT_EXTENDED = 510;
73 constexpr std::int32_t HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511;
74 
75 constexpr bool is_informational(const std::int32_t code) {
76  return (code >= 100 && code < 200);
77 }
78 constexpr bool is_success(const std::int32_t code) {
79  return (code >= 200 && code < 300);
80 }
81 constexpr bool is_redirect(const std::int32_t code) {
82  return (code >= 300 && code < 400);
83 }
84 constexpr bool is_client_error(const std::int32_t code) {
85  return (code >= 400 && code < 500);
86 }
87 constexpr bool is_server_error(const std::int32_t code) {
88  return (code >= 500 && code < 600);
89 }
90 
91 } // namespace status
92 } // namespace cpr
93 #endif
constexpr std::int32_t HTTP_CREATED
Definition: status_codes.h:13
constexpr std::int32_t HTTP_INTERNAL_SERVER_ERROR
Definition: status_codes.h:63
constexpr std::int32_t HTTP_UNSUPPORTED_MEDIA_TYPE
Definition: status_codes.h:48
constexpr std::int32_t HTTP_PROCESSING
Definition: status_codes.h:9
constexpr std::int32_t HTTP_BAD_REQUEST
Definition: status_codes.h:33
constexpr std::int32_t HTTP_CONTINUE
Definition: status_codes.h:7
constexpr std::int32_t HTTP_PROXY_AUTHENTICATION_REQUIRED
Definition: status_codes.h:40
constexpr std::int32_t HTTP_EXPECTATION_FAILED
Definition: status_codes.h:50
constexpr std::int32_t HTTP_REQUEST_TIMEOUT
Definition: status_codes.h:41
constexpr std::int32_t HTTP_FORBIDDEN
Definition: status_codes.h:36
constexpr std::int32_t HTTP_ALREADY_REPORTED
Definition: status_codes.h:20
constexpr std::int32_t HTTP_UNPROCESSABLE_ENTITY
Definition: status_codes.h:53
constexpr std::int32_t HTTP_UPGRADE_REQUIRED
Definition: status_codes.h:57
constexpr std::int32_t HTTP_PRECONDITION_FAILED
Definition: status_codes.h:45
constexpr std::int32_t HTTP_TOO_MANY_REQUESTS
Definition: status_codes.h:59
constexpr std::int32_t HTTP_SWITCHING_PROTOCOL
Definition: status_codes.h:8
constexpr std::int32_t HTTP_SEE_OTHER
Definition: status_codes.h:26
constexpr std::int32_t HTTP_EARLY_HINTS
Definition: status_codes.h:10
constexpr std::int32_t HTTP_ACCEPTED
Definition: status_codes.h:14
constexpr bool is_redirect(const std::int32_t code)
Definition: status_codes.h:81
constexpr std::int32_t HTTP_NOT_FOUND
Definition: status_codes.h:37
constexpr std::int32_t HTTP_NETWORK_AUTHENTICATION_REQUIRED
Definition: status_codes.h:73
constexpr std::int32_t HTTP_MULTIPLE_CHOICE
Definition: status_codes.h:23
constexpr std::int32_t HTTP_NOT_IMPLEMENTED
Definition: status_codes.h:64
constexpr std::int32_t HTTP_PAYLOAD_TOO_LARGE
Definition: status_codes.h:46
constexpr std::int32_t HTTP_NOT_EXTENDED
Definition: status_codes.h:72
constexpr std::int32_t HTTP_RESET_CONTENT
Definition: status_codes.h:17
constexpr std::int32_t HTTP_UNUSED
Definition: status_codes.h:29
constexpr std::int32_t HTTP_MULTI_STATUS
Definition: status_codes.h:19
constexpr std::int32_t HTTP_LENGTH_REQUIRED
Definition: status_codes.h:44
constexpr std::int32_t HTTP_MISDIRECTED_REQUEST
Definition: status_codes.h:52
constexpr std::int32_t HTTP_PAYMENT_REQUIRED
Definition: status_codes.h:35
constexpr std::int32_t HTTP_GATEWAY_TIMEOUT
Definition: status_codes.h:67
constexpr std::int32_t HTTP_NOT_ACCEPTABLE
Definition: status_codes.h:39
constexpr bool is_informational(const std::int32_t code)
Definition: status_codes.h:75
constexpr std::int32_t HTTP_OK
Definition: status_codes.h:12
constexpr std::int32_t HTTP_VARIANT_ALSO_NEGOTIATES
Definition: status_codes.h:69
constexpr std::int32_t HTTP_UNAUTHORIZED
Definition: status_codes.h:34
constexpr std::int32_t HTTP_UNAVAILABLE_FOR_LEGAL_REASONS
Definition: status_codes.h:61
constexpr std::int32_t HTTP_GONE
Definition: status_codes.h:43
constexpr std::int32_t HTTP_URI_TOO_LONG
Definition: status_codes.h:47
constexpr std::int32_t HTTP_IM_A_TEAPOT
Definition: status_codes.h:51
constexpr std::int32_t HTTP_CONFLICT
Definition: status_codes.h:42
constexpr std::int32_t HTTP_PERMANENT_REDIRECT
Definition: status_codes.h:31
constexpr std::int32_t HTTP_MOVED_PERMANENTLY
Definition: status_codes.h:24
constexpr std::int32_t HTTP_FAILED_DEPENDENCY
Definition: status_codes.h:55
constexpr std::int32_t HTTP_TOO_EARLY
Definition: status_codes.h:56
constexpr std::int32_t HTTP_HTTP_VERSION_NOT_SUPPORTED
Definition: status_codes.h:68
constexpr bool is_success(const std::int32_t code)
Definition: status_codes.h:78
constexpr std::int32_t HTTP_NOT_MODIFIED
Definition: status_codes.h:27
Definition: auth.cpp:3
constexpr bool is_client_error(const std::int32_t code)
Definition: status_codes.h:84
constexpr std::int32_t HTTP_BAD_GATEWAY
Definition: status_codes.h:65
constexpr std::int32_t HTTP_PARTIAL_CONTENT
Definition: status_codes.h:18
constexpr bool is_server_error(const std::int32_t code)
Definition: status_codes.h:87
constexpr std::int32_t HTTP_LOCKED
Definition: status_codes.h:54
constexpr std::int32_t HTTP_LOOP_DETECTED
Definition: status_codes.h:71
constexpr std::int32_t HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE
Definition: status_codes.h:60
constexpr std::int32_t HTTP_REQUESTED_RANGE_NOT_SATISFIABLE
Definition: status_codes.h:49
constexpr std::int32_t HTTP_NON_AUTHORITATIVE_INFORMATION
Definition: status_codes.h:15
constexpr std::int32_t HTTP_METHOD_NOT_ALLOWED
Definition: status_codes.h:38
constexpr std::int32_t HTTP_SERVICE_UNAVAILABLE
Definition: status_codes.h:66
constexpr std::int32_t HTTP_FOUND
Definition: status_codes.h:25
constexpr std::int32_t HTTP_NO_CONTENT
Definition: status_codes.h:16
constexpr std::int32_t HTTP_IM_USED
Definition: status_codes.h:21
constexpr std::int32_t HTTP_INSUFFICIENT_STORAGE
Definition: status_codes.h:70
constexpr std::int32_t HTTP_TEMPORARY_REDIRECT
Definition: status_codes.h:30
constexpr std::int32_t HTTP_USE_PROXY
Definition: status_codes.h:28
constexpr std::int32_t HTTP_PRECONDITION_REQUIRED
Definition: status_codes.h:58


rc_tagdetect_client
Author(s): Monika Florek-Jasinska , Raphael Schaller
autogenerated on Sat Feb 13 2021 03:42:16