Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Official HttpStatusCode #24724

Closed
caesar-chen opened this issue Jan 19, 2018 · 1 comment
Closed

Update Official HttpStatusCode #24724

caesar-chen opened this issue Jan 19, 2018 · 1 comment
Assignees
Milestone

Comments

@caesar-chen
Copy link
Contributor

We should update current HttpStatusCode to include more official status codes defined in recent RFCs.

Proposed API

    public enum HttpStatusCode
    {
        // Informational 1xx
        Continue = 100,
        SwitchingProtocols = 101,
+       Processing = 102,
+       EarlyHints = 103,

        // Successful 2xx
        OK = 200,
        Created = 201,
        Accepted = 202,
        NonAuthoritativeInformation = 203,
        NoContent = 204,
        ResetContent = 205,
        PartialContent = 206,
+       MultiStatus = 207,
+       AlreadyReported = 208,
        
+       IMUsed = 226,

        // Redirection 3xx
        MultipleChoices = 300,
        Ambiguous = 300,
        MovedPermanently = 301,
        Moved = 301,
        Found = 302,
        Redirect = 302,
        SeeOther = 303,
        RedirectMethod = 303,
        NotModified = 304,
        UseProxy = 305,
        Unused = 306,
        TemporaryRedirect = 307,
        RedirectKeepVerb = 307,
+       PermanentRedirect = 308,

        // Client Error 4xx
        BadRequest = 400,
        Unauthorized = 401,
        PaymentRequired = 402,
        Forbidden = 403,
        NotFound = 404,
        MethodNotAllowed = 405,
        NotAcceptable = 406,
        ProxyAuthenticationRequired = 407,
        RequestTimeout = 408,
        Conflict = 409,
        Gone = 410,
        LengthRequired = 411,
        PreconditionFailed = 412,
        RequestEntityTooLarge = 413,
        RequestUriTooLong = 414,
        UnsupportedMediaType = 415,
        RequestedRangeNotSatisfiable = 416,
        ExpectationFailed = 417,
+       ImATeapot = 418,

+       MisdirectedRequest = 421,
+       UnprocessableEntity = 422,
+       Locked = 423,
+       FailedDependency = 424,

        UpgradeRequired = 426,
        
+       PreconditionRequired = 428,
+       TooManyRequests = 429,
        
+       RequestHeaderFieldsTooLarge = 431,
        
+       UnavailableForLegalReasons = 451,

        // Server Error 5xx
        InternalServerError = 500,
        NotImplemented = 501,
        BadGateway = 502,
        ServiceUnavailable = 503,
        GatewayTimeout = 504,
        HttpVersionNotSupported = 505,
+       VariantAlsoNegotiates = 506,
+       InsufficientStorage = 507,
+       LoopDetected = 508,
        
+       NotExtended = 510,
+       NetworkAuthenticationRequired = 511,
    }

Details

Values added from WinRT: Windows.Web.Http.HttpStatusCode:

AlreadyReported
FailedDependency
IMUsed
InsufficientStorage
Locked
LoopDetected
MultiStatus
NetworkAuthenticationRequired
None (not sure what's this, not added)
NotExtended
PermanentRedirect
PreconditionRequired
Processing
RequestHeaderFieldsTooLarge
TooManyRequests
UnprocessableEntity
VariantAlsoNegotiates

RFC 2324:

ImATeapot

RFC 7450:

MisdirectedRequest

RFC 7725:

UnavailableForLegalReasons

RFC 8297:

EarlyHints

Related issue: #15650

/cc: @davidsh @karelz

@caesar-chen caesar-chen self-assigned this Jan 19, 2018
@karelz
Copy link
Member

karelz commented Jan 19, 2018

The proposal is now moved back into #15650

@karelz karelz closed this as completed Jan 19, 2018
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants