Refactored HttpStatusCode.cs

This commit is contained in:
sta 2014-04-02 17:26:49 +09:00
parent 0cb2335b48
commit 0ef002be52

View File

@ -1,38 +1,43 @@
// #region License
// HttpStatusCode.cs /*
// Copied from System.Net.HttpStatusCode.cs * HttpStatusCode.cs
// *
// This code was automatically generated from * This code is derived from System.Net.HttpStatusCode.cs of Mono
// ECMA CLI XML Library Specification. * (http://www.mono-project.com).
// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)] *
// Created: Wed, 5 Sep 2001 06:32:05 UTC * This code was automatically generated from ECMA CLI XML Library Specification.
// Source file: AllTypes.xml * Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml * Created: Wed, 5 Sep 2001 06:32:05 UTC
// * Source file: AllTypes.xml
// Copyright (C) 2001 Ximian, Inc. (http://www.ximian.com) * URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
// *
// Permission is hereby granted, free of charge, to any person obtaining * The MIT License
// a copy of this software and associated documentation files (the *
// "Software"), to deal in the Software without restriction, including * Copyright (c) 2001 Ximian, Inc. (http://www.ximian.com)
// without limitation the rights to use, copy, modify, merge, publish, * Copyright (c) 2012-2014 sta.blockhead
// distribute, sublicense, and/or sell copies of the Software, and to *
// permit persons to whom the Software is furnished to do so, subject to * Permission is hereby granted, free of charge, to any person obtaining a copy
// the following conditions: * of this software and associated documentation files (the "Software"), to deal
// * in the Software without restriction, including without limitation the rights
// The above copyright notice and this permission notice shall be * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// included in all copies or substantial portions of the Software. * copies of the Software, and to permit persons to whom the Software is
// * furnished to do so, subject to the following conditions:
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * The above copyright notice and this permission notice shall be included in
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * all copies or substantial portions of the Software.
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE *
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
namespace WebSocketSharp.Net { * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#endregion
namespace WebSocketSharp.Net
{
/// <summary> /// <summary>
/// Contains the values of the HTTP status codes. /// Contains the values of the HTTP status codes.
/// </summary> /// </summary>
@ -40,323 +45,314 @@ namespace WebSocketSharp.Net {
/// The HttpStatusCode enumeration contains the values of the HTTP status codes defined in /// The HttpStatusCode enumeration contains the values of the HTTP status codes defined in
/// <see href="http://tools.ietf.org/html/rfc2616#section-10">RFC 2616</see> for HTTP 1.1. /// <see href="http://tools.ietf.org/html/rfc2616#section-10">RFC 2616</see> for HTTP 1.1.
/// </remarks> /// </remarks>
public enum HttpStatusCode { public enum HttpStatusCode
{
/// <summary> /// <summary>
/// Equivalent to status code 100. Indicates that the client should continue with its request. /// Equivalent to status code 100.
/// Indicates that the client should continue with its request.
/// </summary> /// </summary>
Continue = 100, Continue = 100,
/// <summary> /// <summary>
/// Equivalent to status code 101. Indicates that the server is switching the HTTP version or protocol on the connection. /// Equivalent to status code 101.
/// Indicates that the server is switching the HTTP version or protocol on the connection.
/// </summary> /// </summary>
SwitchingProtocols = 101, SwitchingProtocols = 101,
/// <summary> /// <summary>
/// Equivalent to status code 200. Indicates that the client's request has succeeded. /// Equivalent to status code 200.
/// Indicates that the client's request has succeeded.
/// </summary> /// </summary>
OK = 200, OK = 200,
/// <summary> /// <summary>
/// Equivalent to status code 201. Indicates that the client's request has been fulfilled /// Equivalent to status code 201.
/// and resulted in a new resource being created. /// Indicates that the client's request has been fulfilled and resulted in a new resource being
/// created.
/// </summary> /// </summary>
Created = 201, Created = 201,
/// <summary> /// <summary>
/// Equivalent to status code 202. Indicates that the client's request has been accepted for processing, /// Equivalent to status code 202.
/// but the processing has not been completed. /// Indicates that the client's request has been accepted for processing, but the processing
/// hasn't been completed.
/// </summary> /// </summary>
Accepted = 202, Accepted = 202,
/// <summary> /// <summary>
/// Equivalent to status code 203. Indicates that the returned metainformation is from a local or a third-party copy instead of the origin server. /// Equivalent to status code 203.
/// Indicates that the returned metainformation is from a local or a third-party copy instead of
/// the origin server.
/// </summary> /// </summary>
NonAuthoritativeInformation = 203, NonAuthoritativeInformation = 203,
/// <summary> /// <summary>
/// Equivalent to status code 204. Indicates that the server has fulfilled the client's request /// Equivalent to status code 204.
/// but does not need to return an entity-body. /// Indicates that the server has fulfilled the client's request but doesn't need to return
/// an entity-body.
/// </summary> /// </summary>
NoContent = 204, NoContent = 204,
/// <summary> /// <summary>
/// Equivalent to status code 205. Indicates that the server has fulfilled the client's request /// Equivalent to status code 205.
/// and the user agent should reset the document view which caused the request to be sent. /// Indicates that the server has fulfilled the client's request, and the user agent should
/// reset the document view which caused the request to be sent.
/// </summary> /// </summary>
ResetContent = 205, ResetContent = 205,
/// <summary> /// <summary>
/// Equivalent to status code 206. Indicates that the server has fulfilled the partial GET request for the resource. /// Equivalent to status code 206.
/// Indicates that the server has fulfilled the partial GET request for the resource.
/// </summary> /// </summary>
PartialContent = 206, PartialContent = 206,
/// <summary> /// <summary>
/// <para> /// <para>
/// Equivalent to status code 300. Indicates that the requested resource corresponds to /// Equivalent to status code 300.
/// any one of multiple representations. /// Indicates that the requested resource corresponds to any of multiple representations.
/// </para> /// </para>
/// <para> /// <para>
/// MultipleChoices is a synonym for Ambiguous. /// MultipleChoices is a synonym for Ambiguous.
/// </para> /// </para>
/// </summary> /// </summary>
MultipleChoices = 300, MultipleChoices = 300,
/// <summary> /// <summary>
/// <para> /// <para>
/// Equivalent to status code 300. Indicates that the requested resource corresponds to /// Equivalent to status code 300.
/// any one of multiple representations. /// Indicates that the requested resource corresponds to any of multiple representations.
/// </para> /// </para>
/// <para> /// <para>
/// Ambiguous is a synonym for MultipleChoices. /// Ambiguous is a synonym for MultipleChoices.
/// </para> /// </para>
/// </summary> /// </summary>
Ambiguous = 300, Ambiguous = 300,
/// <summary> /// <summary>
/// <para> /// <para>
/// Equivalent to status code 301. Indicates that the requested resource has been assigned a new permanent URI /// Equivalent to status code 301.
/// and any future references to this resource should use one of the returned URIs. /// Indicates that the requested resource has been assigned a new permanent URI and
/// any future references to this resource should use one of the returned URIs.
/// </para> /// </para>
/// <para> /// <para>
/// MovedPermanently is a synonym for Moved. /// MovedPermanently is a synonym for Moved.
/// </para> /// </para>
/// </summary> /// </summary>
MovedPermanently = 301, MovedPermanently = 301,
/// <summary> /// <summary>
/// <para> /// <para>
/// Equivalent to status code 301. Indicates that the requested resource has been assigned a new permanent URI /// Equivalent to status code 301.
/// and any future references to this resource should use one of the returned URIs. /// Indicates that the requested resource has been assigned a new permanent URI and
/// any future references to this resource should use one of the returned URIs.
/// </para> /// </para>
/// <para> /// <para>
/// Moved is a synonym for MovedPermanently. /// Moved is a synonym for MovedPermanently.
/// </para> /// </para>
/// </summary> /// </summary>
Moved = 301, Moved = 301,
/// <summary> /// <summary>
/// <para> /// <para>
/// Equivalent to status code 302. Indicates that the requested resource is located temporarily /// Equivalent to status code 302.
/// under a different URI. /// Indicates that the requested resource is located temporarily under a different URI.
/// </para> /// </para>
/// <para> /// <para>
/// Found is a synonym for Redirect. /// Found is a synonym for Redirect.
/// </para> /// </para>
/// </summary> /// </summary>
Found = 302, Found = 302,
/// <summary> /// <summary>
/// <para> /// <para>
/// Equivalent to status code 302. Indicates that the requested resource is located temporarily /// Equivalent to status code 302.
/// under a different URI. /// Indicates that the requested resource is located temporarily under a different URI.
/// </para> /// </para>
/// <para> /// <para>
/// Redirect is a synonym for Found. /// Redirect is a synonym for Found.
/// </para> /// </para>
/// </summary> /// </summary>
Redirect = 302, Redirect = 302,
/// <summary> /// <summary>
/// <para> /// <para>
/// Equivalent to status code 303. Indicates that the response to the request can be found /// Equivalent to status code 303.
/// under a different URI and should be retrieved using a GET method on that resource. /// Indicates that the response to the request can be found under a different URI and
/// should be retrieved using a GET method on that resource.
/// </para> /// </para>
/// <para> /// <para>
/// SeeOther is a synonym for RedirectMethod. /// SeeOther is a synonym for RedirectMethod.
/// </para> /// </para>
/// </summary> /// </summary>
SeeOther = 303, SeeOther = 303,
/// <summary> /// <summary>
/// <para> /// <para>
/// Equivalent to status code 303. Indicates that the response to the request can be found /// Equivalent to status code 303.
/// under a different URI and should be retrieved using a GET method on that resource. /// Indicates that the response to the request can be found under a different URI and
/// should be retrieved using a GET method on that resource.
/// </para> /// </para>
/// <para> /// <para>
/// RedirectMethod is a synonym for SeeOther. /// RedirectMethod is a synonym for SeeOther.
/// </para> /// </para>
/// </summary> /// </summary>
RedirectMethod = 303, RedirectMethod = 303,
/// <summary> /// <summary>
/// Equivalent to status code 304. Indicates that the client has performed a conditional GET request /// Equivalent to status code 304.
/// and access is allowed, but the document has not been modified. /// Indicates that the client has performed a conditional GET request and access is allowed,
/// but the document hasn't been modified.
/// </summary> /// </summary>
NotModified = 304, NotModified = 304,
/// <summary> /// <summary>
/// Equivalent to status code 305. Indicates that the requested resource must be accessed /// Equivalent to status code 305.
/// through the proxy given by the Location field. /// Indicates that the requested resource must be accessed through the proxy given by
/// the Location field.
/// </summary> /// </summary>
UseProxy = 305, UseProxy = 305,
/// <summary> /// <summary>
/// Equivalent to status code 306. This code was used in a previous version of the specification, /// Equivalent to status code 306.
/// is no longer used, and is reserved for future use. /// This status code was used in a previous version of the specification, is no longer used,
/// and is reserved for future use.
/// </summary> /// </summary>
Unused = 306, Unused = 306,
/// <summary> /// <summary>
/// <para> /// <para>
/// Equivalent to status code 307. Indicates that the requested resource is located temporarily /// Equivalent to status code 307.
/// under a different URI. /// Indicates that the requested resource is located temporarily under a different URI.
/// </para> /// </para>
/// <para> /// <para>
/// TemporaryRedirect is a synonym for RedirectKeepVerb. /// TemporaryRedirect is a synonym for RedirectKeepVerb.
/// </para> /// </para>
/// </summary> /// </summary>
TemporaryRedirect = 307, TemporaryRedirect = 307,
/// <summary> /// <summary>
/// <para> /// <para>
/// Equivalent to status code 307. Indicates that the requested resource is located temporarily /// Equivalent to status code 307.
/// under a different URI. /// Indicates that the requested resource is located temporarily under a different URI.
/// </para> /// </para>
/// <para> /// <para>
/// RedirectKeepVerb is a synonym for TemporaryRedirect. /// RedirectKeepVerb is a synonym for TemporaryRedirect.
/// </para> /// </para>
/// </summary> /// </summary>
RedirectKeepVerb = 307, RedirectKeepVerb = 307,
/// <summary> /// <summary>
/// Equivalent to status code 400. Indicates that the client's request could not be understood /// Equivalent to status code 400.
/// by the server due to malformed syntax. /// Indicates that the client's request couldn't be understood by the server due to
/// malformed syntax.
/// </summary> /// </summary>
BadRequest = 400, BadRequest = 400,
/// <summary> /// <summary>
/// Equivalent to status code 401. Indicates that the client's request requires user authentication. /// Equivalent to status code 401.
/// Indicates that the client's request requires user authentication.
/// </summary> /// </summary>
Unauthorized = 401, Unauthorized = 401,
/// <summary> /// <summary>
/// Equivalent to status code 402. This code is reserved for future use. /// Equivalent to status code 402.
/// This status code is reserved for future use.
/// </summary> /// </summary>
PaymentRequired = 402, PaymentRequired = 402,
/// <summary> /// <summary>
/// Equivalent to status code 403. Indicates that the server understood the client's request /// Equivalent to status code 403.
/// but is refusing to fulfill it. /// Indicates that the server understood the client's request but is refusing to fulfill it.
/// </summary> /// </summary>
Forbidden = 403, Forbidden = 403,
/// <summary> /// <summary>
/// Equivalent to status code 404. Indicates that the server has not found anything /// Equivalent to status code 404.
/// matching the request URI. /// Indicates that the server hasn't found anything matching the request URI.
/// </summary> /// </summary>
NotFound = 404, NotFound = 404,
/// <summary> /// <summary>
/// Equivalent to status code 405. Indicates that the method specified in the request line /// Equivalent to status code 405.
/// is not allowed for the resource identified by the request URI. /// Indicates that the method specified in the request line isn't allowed for the resource
/// identified by the request URI.
/// </summary> /// </summary>
MethodNotAllowed = 405, MethodNotAllowed = 405,
/// <summary> /// <summary>
/// Equivalent to status code 406. Indicates that the server does not have the appropriate resource /// Equivalent to status code 406.
/// to respond to the accept headers in the client's request. /// Indicates that the server doesn't have the appropriate resource to respond to the accept
/// headers in the client's request.
/// </summary> /// </summary>
NotAcceptable = 406, NotAcceptable = 406,
/// <summary> /// <summary>
/// Equivalent to status code 407. Indicates that the client must first authenticate itself with the proxy. /// Equivalent to status code 407.
/// Indicates that the client must first authenticate itself with the proxy.
/// </summary> /// </summary>
ProxyAuthenticationRequired = 407, ProxyAuthenticationRequired = 407,
/// <summary> /// <summary>
/// Equivalent to status code 408. Indicates that the client did not produce a request /// Equivalent to status code 408.
/// within the time that the server was prepared to wait. /// Indicates that the client didn't produce a request within the time that the server was
/// prepared to wait.
/// </summary> /// </summary>
RequestTimeout = 408, RequestTimeout = 408,
/// <summary> /// <summary>
/// Equivalent to status code 409. Indicates that the client's request could not be completed /// Equivalent to status code 409.
/// due to a conflict on the server. /// Indicates that the client's request couldn't be completed due to a conflict on the server.
/// </summary> /// </summary>
Conflict = 409, Conflict = 409,
/// <summary> /// <summary>
/// Equivalent to status code 410. Indicates that the requested resource is no longer available /// Equivalent to status code 410.
/// at the server and no forwarding address is known. /// Indicates that the requested resource is no longer available at the server and
/// no forwarding address is known.
/// </summary> /// </summary>
Gone = 410, Gone = 410,
/// <summary> /// <summary>
/// Equivalent to status code 411. Indicates that the server refuses to accept the client's request /// Equivalent to status code 411.
/// without a defined Content-Length. /// Indicates that the server refuses to accept the client's request without a defined
/// Content-Length.
/// </summary> /// </summary>
LengthRequired = 411, LengthRequired = 411,
/// <summary> /// <summary>
/// Equivalent to status code 412. Indicates that the precondition given in one or more of the request header fields /// Equivalent to status code 412.
/// Indicates that the precondition given in one or more of the request header fields
/// evaluated to false when it was tested on the server. /// evaluated to false when it was tested on the server.
/// </summary> /// </summary>
PreconditionFailed = 412, PreconditionFailed = 412,
/// <summary> /// <summary>
/// Equivalent to status code 413. Indicates that the client's request entity is larger /// Equivalent to status code 413.
/// than the server is willing or able to process. /// Indicates that the entity of the client's request is larger than the server is willing or
/// able to process.
/// </summary> /// </summary>
RequestEntityTooLarge = 413, RequestEntityTooLarge = 413,
/// <summary> /// <summary>
/// Equivalent to status code 414. Indicates that the request URI is longer /// Equivalent to status code 414.
/// than the server is willing to interpret. /// Indicates that the request URI is longer than the server is willing to interpret.
/// </summary> /// </summary>
RequestUriTooLong = 414, RequestUriTooLong = 414,
/// <summary> /// <summary>
/// Equivalent to status code 415. Indicates that the entity of the client's request is in a format /// Equivalent to status code 415.
/// not supported by the requested resource for the requested method. /// Indicates that the entity of the client's request is in a format not supported by
/// the requested resource for the requested method.
/// </summary> /// </summary>
UnsupportedMediaType = 415, UnsupportedMediaType = 415,
/// <summary> /// <summary>
/// Equivalent to status code 416. Indicates that none of the range specifier values in a Range request header field /// Equivalent to status code 416.
/// Indicates that none of the range specifier values in a Range request header field
/// overlap the current extent of the selected resource. /// overlap the current extent of the selected resource.
/// </summary> /// </summary>
RequestedRangeNotSatisfiable = 416, RequestedRangeNotSatisfiable = 416,
/// <summary> /// <summary>
/// Equivalent to status code 417. Indicates that the expectation given in an Expect request header field /// Equivalent to status code 417.
/// could not be met by the server. /// Indicates that the expectation given in an Expect request header field couldn't be met by
/// the server.
/// </summary> /// </summary>
ExpectationFailed = 417, ExpectationFailed = 417,
/// <summary> /// <summary>
/// Equivalent to status code 500. Indicates that the server encountered an unexpected condition /// Equivalent to status code 500.
/// which prevented it from fulfilling the client's request. /// Indicates that the server encountered an unexpected condition which prevented it from
/// fulfilling the client's request.
/// </summary> /// </summary>
InternalServerError = 500, InternalServerError = 500,
/// <summary> /// <summary>
/// Equivalent to status code 501. Indicates that the server does not support the functionality /// Equivalent to status code 501.
/// required to fulfill the client's request. /// Indicates that the server doesn't support the functionality required to fulfill the client's
/// request.
/// </summary> /// </summary>
NotImplemented = 501, NotImplemented = 501,
/// <summary> /// <summary>
/// Equivalent to status code 502. Indicates that a gateway or proxy server received an invalid response /// Equivalent to status code 502.
/// from the upstream server. /// Indicates that a gateway or proxy server received an invalid response from the upstream
/// server.
/// </summary> /// </summary>
BadGateway = 502, BadGateway = 502,
/// <summary> /// <summary>
/// Equivalent to status code 503. Indicates that the server is currently unable to handle the client's request /// Equivalent to status code 503.
/// due to a temporary overloading or maintenance of the server. /// Indicates that the server is currently unable to handle the client's request due to
/// a temporary overloading or maintenance of the server.
/// </summary> /// </summary>
ServiceUnavailable = 503, ServiceUnavailable = 503,
/// <summary> /// <summary>
/// Equivalent to status code 504. Indicates that a gateway or proxy server did not receive a timely response /// Equivalent to status code 504.
/// from the upstream server or some other auxiliary server. /// Indicates that a gateway or proxy server didn't receive a timely response from the upstream
/// server or some other auxiliary server.
/// </summary> /// </summary>
GatewayTimeout = 504, GatewayTimeout = 504,
/// <summary> /// <summary>
/// Equivalent to status code 505. Indicates that the server does not support the HTTP version /// Equivalent to status code 505.
/// used in the client's request. /// Indicates that the server doesn't support the HTTP version used in the client's request.
/// </summary> /// </summary>
HttpVersionNotSupported = 505, HttpVersionNotSupported = 505,
} }