Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/System.Net.Primitives/ref/System.Net.Primitives.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,52 +126,71 @@ protected EndPoint() { }
public enum HttpStatusCode
{
Accepted = 202,
AlreadyReported = 208,
Ambiguous = 300,
BadGateway = 502,
BadRequest = 400,
Conflict = 409,
Continue = 100,
Created = 201,
EarlyHints = 103,
ExpectationFailed = 417,
FailedDependency = 424,
Forbidden = 403,
Found = 302,
GatewayTimeout = 504,
Gone = 410,
HttpVersionNotSupported = 505,
IMUsed = 226,
InsufficientStorage = 507,
InternalServerError = 500,
LengthRequired = 411,
Locked = 423,
LoopDetected = 508,
MethodNotAllowed = 405,
MisdirectedRequest = 421,
Moved = 301,
MovedPermanently = 301,
MultipleChoices = 300,
MultiStatus = 207,
NetworkAuthenticationRequired = 511,
NoContent = 204,
NonAuthoritativeInformation = 203,
NotAcceptable = 406,
NotExtended = 510,
NotFound = 404,
NotImplemented = 501,
NotModified = 304,
OK = 200,
PartialContent = 206,
PaymentRequired = 402,
PermanentRedirect = 308,
PreconditionFailed = 412,
PreconditionRequired = 428,
Processing = 102,
ProxyAuthenticationRequired = 407,
Redirect = 302,
RedirectKeepVerb = 307,
RedirectMethod = 303,
RequestedRangeNotSatisfiable = 416,
RequestEntityTooLarge = 413,
RequestHeaderFieldsTooLarge = 431,
RequestTimeout = 408,
RequestUriTooLong = 414,
ResetContent = 205,
SeeOther = 303,
ServiceUnavailable = 503,
SwitchingProtocols = 101,
TemporaryRedirect = 307,
TooManyRequests = 429,
Unauthorized = 401,
UnavailableForLegalReasons = 451,
UnprocessableEntity = 422,
UnsupportedMediaType = 415,
Unused = 306,
UpgradeRequired = 426,
UseProxy = 305,
VariantAlsoNegotiates = 506
}
public partial interface ICredentials
{
Expand Down
29 changes: 29 additions & 0 deletions src/System.Net.Primitives/src/System/Net/HttpStatusCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public enum HttpStatusCode
// Informational 1xx
Continue = 100,
SwitchingProtocols = 101,
Processing = 102,
EarlyHints = 103,

// Successful 2xx
OK = 200,
Expand All @@ -19,6 +21,10 @@ public enum HttpStatusCode
NoContent = 204,
ResetContent = 205,
PartialContent = 206,
MultiStatus = 207,
AlreadyReported = 208,

IMUsed = 226,

// Redirection 3xx
MultipleChoices = 300,
Expand All @@ -34,6 +40,7 @@ public enum HttpStatusCode
Unused = 306,
TemporaryRedirect = 307,
RedirectKeepVerb = 307,
PermanentRedirect = 308,

// Client Error 4xx
BadRequest = 400,
Expand All @@ -54,15 +61,37 @@ public enum HttpStatusCode
UnsupportedMediaType = 415,
RequestedRangeNotSatisfiable = 416,
ExpectationFailed = 417,
// From the discussion thread on #4382:
// "It would be a mistake to add it to .NET now. See golang/go#21326,
// nodejs/node#14644, requests/requests#4238 and aspnet/HttpAbstractions#915".
// 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
}
}