diff --git a/src/Microsoft.AspNetCore.Http.Abstractions/StatusCodes.cs b/src/Microsoft.AspNetCore.Http.Abstractions/StatusCodes.cs index bcc84878..2efccfc5 100644 --- a/src/Microsoft.AspNetCore.Http.Abstractions/StatusCodes.cs +++ b/src/Microsoft.AspNetCore.Http.Abstractions/StatusCodes.cs @@ -3,8 +3,10 @@ namespace Microsoft.AspNetCore.Http { + // Status Codes listed at http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml public static class StatusCodes { + public const int Status100Continue = 100; public const int Status101SwitchingProtocols = 101; public const int Status200OK = 200; @@ -46,9 +48,14 @@ public static class StatusCodes public const int Status417ExpectationFailed = 417; public const int Status418ImATeapot = 418; public const int Status419AuthenticationTimeout = 419; + public const int Status421MisdirectedRequest = 421; public const int Status422UnprocessableEntity = 422; public const int Status423Locked = 423; public const int Status424FailedDependency = 424; + public const int Status426UpgradeRequired = 426; + public const int Status428PreconditionRequired = 428; + public const int Status429TooManyRequests = 429; + public const int Status431RequestHeaderFieldsTooLarge = 431; public const int Status451UnavailableForLegalReasons = 451; public const int Status500InternalServerError = 500; @@ -59,5 +66,7 @@ public static class StatusCodes public const int Status505HttpVersionNotsupported = 505; public const int Status506VariantAlsoNegotiates = 506; public const int Status507InsufficientStorage = 507; + public const int Status510NotExtended = 510; + public const int Status511NetworkAuthenticationRequired = 511; } } diff --git a/src/Microsoft.AspNetCore.WebUtilities/ReasonPhrases.cs b/src/Microsoft.AspNetCore.WebUtilities/ReasonPhrases.cs index eb6aa120..8d6cf0b8 100644 --- a/src/Microsoft.AspNetCore.WebUtilities/ReasonPhrases.cs +++ b/src/Microsoft.AspNetCore.WebUtilities/ReasonPhrases.cs @@ -7,8 +7,10 @@ namespace Microsoft.AspNetCore.WebUtilities { public static class ReasonPhrases { + // Status Codes listed at http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml private static IDictionary Phrases = new Dictionary() { + { 100, "Continue" }, { 101, "Switching Protocols" }, { 200, "OK" }, @@ -18,6 +20,7 @@ public static class ReasonPhrases { 204, "No Content" }, { 205, "Reset Content" }, { 206, "Partial Content" }, + { 207, "Multi-Status" }, { 300, "Multiple Choices" }, { 301, "Moved Permanently" }, @@ -27,6 +30,7 @@ public static class ReasonPhrases { 305, "Use Proxy" }, { 306, "Switch Proxy" }, { 307, "Temporary Redirect" }, + { 308, "Permanent Redirect" }, { 400, "Bad Request" }, { 401, "Unauthorized" }, @@ -48,6 +52,15 @@ public static class ReasonPhrases { 417, "Expectation Failed" }, { 418, "I'm a teapot" }, { 419, "Authentication Timeout" }, + { 421, "Misdirected Request" }, + { 422, "Unprocessable Entity" }, + { 423, "Locked" }, + { 424, "Failed Dependency" }, + { 426, "Upgrade Required" }, + { 428, "Precondition Required" }, + { 429, "Too Many Requests" }, + { 431, "Request Header Fields Too Large" }, + { 451, "Unavailable For Legal Reasons" }, { 500, "Internal Server Error" }, { 501, "Not Implemented" }, @@ -56,6 +69,9 @@ public static class ReasonPhrases { 504, "Gateway Timeout" }, { 505, "HTTP Version Not Supported" }, { 506, "Variant Also Negotiates" }, + { 507, "Insufficient Storage" }, + { 510, "Not Extended" }, + { 511, "Network Authentication Required" }, }; public static string GetReasonPhrase(int statusCode)