Enum HttpStatusCode
Contains the values of status codes defined for HTTP.
public enum HttpStatusCode
Fields
Accepted = 202Equivalent to HTTP status 202. Indicates that the request has been accepted for further processing.
Ambiguous = 300Equivalent to HTTP status 300. Indicates that the requested information has multiple representations. The default action is to treat this status as a redirect and follow the contents of the Location header associated with this response.
If the HttpWebRequest.AllowAutoRedirect property is
false ,Ambiguous will cause an exception to be thrown.Ambiguous is a synonym forMultipleChoices .BadGateway = 502Equivalent to HTTP status 502. Indicates that an intermediate proxy server received a bad response from another proxy or the origin server.
BadRequest = 400Equivalent to HTTP status 400. Indicates that the request could not be understood by the server.
BadRequest is sent when no other error is applicable, or if the exact error is unknown or does not have its own error code.Conflict = 409Equivalent to HTTP status 409. Indicates that the request could not be carried out because of a conflict on the server.
Continue = 100Equivalent to HTTP status 100. Indicates that the client can continue with its request.
Created = 201Equivalent to HTTP status 201. Indicates that the request resulted in a new resource created before the response was sent.
ExpectationFailed = 417Equivalent to HTTP status 417. Indicates that an expectation given in an Expect header could not be met by the server.
Forbidden = 403Equivalent to HTTP status 403. Indicates that the server refuses to fulfill the request.
Found = 302Equivalent to HTTP status 302. Indicates that the requested information is located at the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response. When the original request method was POST, the redirected request will use the GET method.
If the HttpWebRequest.AllowAutoRedirect property is
false ,Found will cause an exception to be thrown.Found is a synonym forRedirect .GatewayTimeout = 504Equivalent to HTTP status 504. Indicates that an intermediate proxy server timed out while waiting for a response from another proxy or the origin server.
Gone = 410Equivalent to HTTP status 410. Indicates that the requested resource is no longer available.
HttpVersionNotSupported = 505Equivalent to HTTP status 505. Indicates that the requested HTTP version is not supported by the server.
InternalServerError = 500Equivalent to HTTP status 500. Indicates that a generic error has occurred on the server.
LengthRequired = 411Equivalent to HTTP status 411. Indicates that the required Content-length header is missing.
MethodNotAllowed = 405Equivalent to HTTP status 405. Indicates that the request method (POST or GET) is not allowed on the requested resource.
Moved = 301Equivalent to HTTP status 301. Indicates that the requested information has been moved to the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response. When the original request method was POST, the redirected request will use the GET method.
Moved is a synonym forMovedPermanently .MovedPermanently = 301Equivalent to HTTP status 301. Indicates that the requested information has been moved to the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response.
MovedPermanently is a synonym forMoved .MultipleChoices = 300Equivalent to HTTP status 300. Indicates that the requested information has multiple representations. The default action is to treat this status as a redirect and follow the contents of the Location header associated with this response.
If the HttpWebRequest.AllowAutoRedirect property is
false ,MultipleChoices will cause an exception to be thrown.MultipleChoices is a synonym forAmbiguous .NoContent = 204Equivalent to HTTP status 204. Indicates that the request has been successfully processed and that the response is intentionally blank.
NonAuthoritativeInformation = 203Equivalent to HTTP status 203. Indicates that the returned metainformation is from a cached copy instead of the origin server and therefore may be incorrect.
NotAcceptable = 406Equivalent to HTTP status 406. Indicates that the client has indicated with Accept headers that it will not accept any of the available representations of the resource.
NotFound = 404Equivalent to HTTP status 404. Indicates that the requested resource does not exist on the server.
NotImplemented = 501Equivalent to HTTP status 501. Indicates that the server does not support the requested function.
NotModified = 304Equivalent to HTTP status 304. Indicates that the client's cached copy is up-to-date. The contents of the resource are not transferred.
OK = 200Equivalent to HTTP status 200. Indicates that the request succeeded and that the requested information is in the response. This is the most common status code to receive.
PartialContent = 206Equivalent to HTTP status 206. Indicates that the response is a partial response as requested by a GET request that includes a byte range.
PaymentRequired = 402Equivalent to HTTP status 402. Reserved for future use.
PreconditionFailed = 412Equivalent to HTTP status 412. Indicates that a condition set for this request failed, and the request cannot be carried out. Conditions are set with conditional request headers like If-Match, If-None-Match, or If-Unmodified-Since.
ProxyAuthenticationRequired = 407Equivalent to HTTP status 407. Indicates that the requested proxy requires authentication. The Proxy-authenticate header contains the details of how to perform the authentication.
Redirect = 302Equivalent to HTTP status 302. Indicates that the requested information is located at the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response. When the original request method was POST, the redirected request will use the GET method.
If the HttpWebRequest.AllowAutoRedirect property is
false ,Redirect will cause an exception to be thrown.Redirect is a synonym forFound .RedirectKeepVerb = 307Equivalent to HTTP status 307. Indicates that the request information is located at the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response. When the original request method was POST, the redirected request will also use the POST method.
If the HttpWebRequest.AllowAutoRedirect property is
false ,RedirectKeepVerb will cause an exception to be thrown.RedirectKeepVerb is a synonym forTemporaryRedirect .RedirectMethod = 303Equivalent to HTTP status 303. Automatically redirects the client to the URI specified in the Location header as the result of a POST. The request to the resource specified by the Location header will be made with a GET.
If the HttpWebRequest.AllowAutoRedirect property is
false ,RedirectMethod will cause an exception to be thrown.RedirectMethod is a synonym forSeeOther .RequestEntityTooLarge = 413Equivalent to HTTP status 413. Indicates that the request is too large for the server to process.
RequestTimeout = 408Equivalent to HTTP status 408. Indicates that the client did not send a request within the time the server was expecting the request.
RequestUriTooLong = 414Equivalent to HTTP status 414. Indicates that the URI is too long.
RequestedRangeNotSatisfiable = 416Equivalent to HTTP status 416. Indicates that the range of data requested from the resource cannot be returned, either because the beginning of the range is before the beginning of the resource, or the end of the range is after the end of the resource.
ResetContent = 205Equivalent to HTTP status 205. Indicates that the client should reset (not reload) the current resource.
SeeOther = 303Equivalent to HTTP status 303. Automatically redirects the client to the URI specified in the Location header as the result of a POST. The request to the resource specified by the Location header will be made with a GET.
If the HttpWebRequest.AllowAutoRedirect property is
false ,SeeOther will cause an exception to be thrown.SeeOther is a synonym forRedirectMethod .Equivalent to HTTP status 503. Indicates that the server is temporarily unavailable, usually due to high load or maintenance.
SwitchingProtocols = 101Equivalent to HTTP status 101. Indicates that the protocol version or protocol is being changed.
TemporaryRedirect = 307Equivalent to HTTP status 307. Indicates that the request information is located at the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response. When the original request method was POST, the redirected request will also use the POST method.
If the HttpWebRequest.AllowAutoRedirect property is
false ,TemporaryRedirect will cause an exception to be thrown.TemporaryRedirect is a synonym forRedirectKeepVerb .Equivalent to HTTP status 401. Indicates that the requested resource requires authentication. The WWW-Authenticate header contains the details of how to perform the authentication.
UnsupportedMediaType = 415Equivalent to HTTP status 415. Indicates that the request is an unsupported type.
Unused = 306Equivalent to HTTP status 306. This value is a proposed extension to the HTTP/1.1 specification that is not fully specified.
UseProxy = 305Equivalent to HTTP status 305. Indicates that the request should use the proxy server at the URI specified in the Location header.
Remarks
Status codes indicate categories, as follows:
1xx -- Informational.
2xx -- Successful.
3xx -- Redirection.
4xx -- Client Error.
5xx -- Server Error.