11USERVER_NAMESPACE_BEGIN
21 kSwitchingProtocols = 101,
29 kNonAuthoritativeInformation = 203,
32 kPartialContent = 206,
34 kAlreadyReported = 208,
39 kMultipleChoices = 300,
40 kMovedPermanently = 301,
46 kTemporaryRedirect = 307,
47 kPermanentRedirect = 308,
52 kPaymentRequired = 402,
55 kMethodNotAllowed = 405,
57 kProxyAuthenticationRequired = 407,
58 kRequestTimeout = 408,
61 kLengthRequired = 411,
62 kPreconditionFailed = 412,
63 kPayloadTooLarge = 413,
65 kUnsupportedMediaType = 415,
66 kRangeNotSatisfiable = 416,
67 kExpectationFailed = 417,
71 kMisdirectedRequest = 421,
72 kUnprocessableEntity = 422,
74 kFailedDependency = 424,
76 kUpgradeRequired = 426,
77 kPreconditionRequired = 428,
78 kTooManyRequests = 429,
79 kRequestHeaderFieldsTooLarge = 431,
80 kNginxNoResponse = 444,
81 kUnavailableForLegalReasons = 451,
82 kNginxRequestHeaderTooLarge = 494,
83 kNginxSSLCertificateError = 495,
84 kNginxSSLCertificateRequired = 496,
85 kNginxHTTPRequestSenttoHTTPSPort = 497,
86 kDeadlineExpired = 498,
87 kNginxClientClosedRequest = 499,
90 kInternalServerError = 500,
91 kNotImplemented = 501,
93 kServiceUnavailable = 503,
94 kGatewayTimeout = 504,
95 kHttpVersionNotSupported = 505,
96 kVariantAlsoNegotiates = 506,
97 kInsufficientStorage = 507,
99 kBandwidthLimitExceeded = 509,
101 kNetworkAuthenticationRequired = 511,
102 kWebServerIsDown = 520,
103 kConnectionTimedOut = 522,
104 kOriginIsUnreachable = 523,
105 kTimeoutOccurred = 524,
106 kSslHandshakeFailed = 525,
107 kInvalidSslCertificate = 526,
113 NoContent = kNoContent,
114 BadRequest = kBadRequest,
115 NotFound = kNotFound,
116 Conflict = kConflict,
117 TooManyRequests = kTooManyRequests,
118 InternalServerError = kInternalServerError,
119 kClientClosedRequest = kNginxClientClosedRequest,
122std::string_view StatusCodeString(StatusCode status);
126std::ostream& operator<<(std::ostream& os,
StatusCode s);
133struct fmt::formatter<USERVER_NAMESPACE::http::StatusCode> {
134 constexpr static auto parse(format_parse_context& ctx) {
return ctx.begin(); }
136 template <
typename FormatContext>
137 auto format(USERVER_NAMESPACE::http::StatusCode status, FormatContext& ctx)
const {
138 return fmt::format_to(
139 ctx.out(),
"{} {}",
static_cast<
int>(status), USERVER_NAMESPACE::http::StatusCodeString(status)