The Labs \ Source Viewer \ SSCLI \ System.Net \ HttpStatusCode

  1. //------------------------------------------------------------------------------
  2. // <copyright file="HttpStatusCode.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.Net
  16. {
  17.    
  18.     //
  19.     // Redirect Status code numbers that need to be defined.
  20.     //
  21.    
  22.     /// <devdoc>
  23.     /// <para>Contains the values of status
  24.     /// codes defined for the HTTP protocol.</para>
  25.     /// </devdoc>
  26.     //UEUE : Any int can be cast to a HttpStatusCode to allow checking for non http1.1 codes.
  27.     public enum HttpStatusCode
  28.     {
  29.        
  30.         //
  31.         // Informational 1xx
  32.         //
  33.         /// <devdoc>
  34.         /// <para>[To be supplied.]</para>
  35.         /// </devdoc>
  36.         Continue = 100,
  37.         /// <devdoc>
  38.         /// <para>[To be supplied.]</para>
  39.         /// </devdoc>
  40.         SwitchingProtocols = 101,
  41.        
  42.         //
  43.         // Successful 2xx
  44.         //
  45.         /// <devdoc>
  46.         /// <para>[To be supplied.]</para>
  47.         /// </devdoc>
  48.         OK = 200,
  49.         /// <devdoc>
  50.         /// <para>[To be supplied.]</para>
  51.         /// </devdoc>
  52.         Created = 201,
  53.         /// <devdoc>
  54.         /// <para>[To be supplied.]</para>
  55.         /// </devdoc>
  56.         Accepted = 202,
  57.         /// <devdoc>
  58.         /// <para>[To be supplied.]</para>
  59.         /// </devdoc>
  60.         NonAuthoritativeInformation = 203,
  61.         /// <devdoc>
  62.         /// <para>[To be supplied.]</para>
  63.         /// </devdoc>
  64.         NoContent = 204,
  65.         /// <devdoc>
  66.         /// <para>[To be supplied.]</para>
  67.         /// </devdoc>
  68.         ResetContent = 205,
  69.         /// <devdoc>
  70.         /// <para>[To be supplied.]</para>
  71.         /// </devdoc>
  72.         PartialContent = 206,
  73.        
  74.         //
  75.         // Redirection 3xx
  76.         //
  77.         /// <devdoc>
  78.         /// <para>[To be supplied.]</para>
  79.         /// </devdoc>
  80.         MultipleChoices = 300,
  81.         /// <devdoc>
  82.         /// <para>[To be supplied.]</para>
  83.         /// </devdoc>
  84.         Ambiguous = 300,
  85.         /// <devdoc>
  86.         /// <para>[To be supplied.]</para>
  87.         /// </devdoc>
  88.         MovedPermanently = 301,
  89.         /// <devdoc>
  90.         /// <para>[To be supplied.]</para>
  91.         /// </devdoc>
  92.         Moved = 301,
  93.         /// <devdoc>
  94.         /// <para>[To be supplied.]</para>
  95.         /// </devdoc>
  96.         Found = 302,
  97.         /// <devdoc>
  98.         /// <para>[To be supplied.]</para>
  99.         /// </devdoc>
  100.         Redirect = 302,
  101.         /// <devdoc>
  102.         /// <para>[To be supplied.]</para>
  103.         /// </devdoc>
  104.         SeeOther = 303,
  105.         /// <devdoc>
  106.         /// <para>[To be supplied.]</para>
  107.         /// </devdoc>
  108.         RedirectMethod = 303,
  109.         /// <devdoc>
  110.         /// <para>[To be supplied.]</para>
  111.         /// </devdoc>
  112.         NotModified = 304,
  113.         /// <devdoc>
  114.         /// <para>[To be supplied.]</para>
  115.         /// </devdoc>
  116.         UseProxy = 305,
  117.         /// <devdoc>
  118.         /// <para>[To be supplied.]</para>
  119.         /// </devdoc>
  120.         Unused = 306,
  121.         /// <devdoc>
  122.         /// <para>[To be supplied.]</para>
  123.         /// </devdoc>
  124.         TemporaryRedirect = 307,
  125.         /// <devdoc>
  126.         /// <para>[To be supplied.]</para>
  127.         /// </devdoc>
  128.         RedirectKeepVerb = 307,
  129.        
  130.         //
  131.         // Client Error 4xx
  132.         //
  133.         /// <devdoc>
  134.         /// <para>[To be supplied.]</para>
  135.         /// </devdoc>
  136.         BadRequest = 400,
  137.         /// <devdoc>
  138.         /// <para>[To be supplied.]</para>
  139.         /// </devdoc>
  140.         Unauthorized = 401,
  141.         /// <devdoc>
  142.         /// <para>[To be supplied.]</para>
  143.         /// </devdoc>
  144.         PaymentRequired = 402,
  145.         /// <devdoc>
  146.         /// <para>[To be supplied.]</para>
  147.         /// </devdoc>
  148.         Forbidden = 403,
  149.         /// <devdoc>
  150.         /// <para>[To be supplied.]</para>
  151.         /// </devdoc>
  152.         NotFound = 404,
  153.         /// <devdoc>
  154.         /// <para>[To be supplied.]</para>
  155.         /// </devdoc>
  156.         MethodNotAllowed = 405,
  157.         /// <devdoc>
  158.         /// <para>[To be supplied.]</para>
  159.         /// </devdoc>
  160.         NotAcceptable = 406,
  161.         /// <devdoc>
  162.         /// <para>[To be supplied.]</para>
  163.         /// </devdoc>
  164.         ProxyAuthenticationRequired = 407,
  165.         /// <devdoc>
  166.         /// <para>[To be supplied.]</para>
  167.         /// </devdoc>
  168.         RequestTimeout = 408,
  169.         /// <devdoc>
  170.         /// <para>[To be supplied.]</para>
  171.         /// </devdoc>
  172.         Conflict = 409,
  173.         /// <devdoc>
  174.         /// <para>[To be supplied.]</para>
  175.         /// </devdoc>
  176.         Gone = 410,
  177.         /// <devdoc>
  178.         /// <para>[To be supplied.]</para>
  179.         /// </devdoc>
  180.         LengthRequired = 411,
  181.         /// <devdoc>
  182.         /// <para>[To be supplied.]</para>
  183.         /// </devdoc>
  184.         PreconditionFailed = 412,
  185.         /// <devdoc>
  186.         /// <para>[To be supplied.]</para>
  187.         /// </devdoc>
  188.         RequestEntityTooLarge = 413,
  189.         /// <devdoc>
  190.         /// <para>[To be supplied.]</para>
  191.         /// </devdoc>
  192.         RequestUriTooLong = 414,
  193.         /// <devdoc>
  194.         /// <para>[To be supplied.]</para>
  195.         /// </devdoc>
  196.         UnsupportedMediaType = 415,
  197.         /// <devdoc>
  198.         /// <para>[To be supplied.]</para>
  199.         /// </devdoc>
  200.         RequestedRangeNotSatisfiable = 416,
  201.         /// <devdoc>
  202.         /// <para>[To be supplied.]</para>
  203.         /// </devdoc>
  204.         ExpectationFailed = 417,
  205.        
  206.         //
  207.         // Server Error 5xx
  208.         //
  209.         /// <devdoc>
  210.         /// <para>[To be supplied.]</para>
  211.         /// </devdoc>
  212.         InternalServerError = 500,
  213.         /// <devdoc>
  214.         /// <para>[To be supplied.]</para>
  215.         /// </devdoc>
  216.         NotImplemented = 501,
  217.         /// <devdoc>
  218.         /// <para>[To be supplied.]</para>
  219.         /// </devdoc>
  220.         BadGateway = 502,
  221.         /// <devdoc>
  222.         /// <para>[To be supplied.]</para>
  223.         /// </devdoc>
  224.         ServiceUnavailable = 503,
  225.         /// <devdoc>
  226.         /// <para>[To be supplied.]</para>
  227.         /// </devdoc>
  228.         GatewayTimeout = 504,
  229.         /// <devdoc>
  230.         /// <para>[To be supplied.]</para>
  231.         /// </devdoc>
  232.         HttpVersionNotSupported = 505
  233.        
  234.     }
  235.     // enum HttpStatusCode
  236.    
  237.    
  238.     /*
  239. Fielding, et al.            Standards Track                    [Page 3]
  240. RFC 2616                        HTTP/1.1                      June 1999
  241.   10.1  Informational 1xx ...........................................57
  242.   10.1.1  100 Continue .............................................58
  243.   10.1.2  101 Switching Protocols ..................................58
  244.   10.2  Successful 2xx ..............................................58
  245.   10.2.1  200 OK ...................................................58
  246.   10.2.2  201 Created ..............................................59
  247.   10.2.3  202 Accepted .............................................59
  248.   10.2.4  203 Non-Authoritative Information ........................59
  249.   10.2.5  204 No Content ...........................................60
  250.   10.2.6  205 Reset Content ........................................60
  251.   10.2.7  206 Partial Content ......................................60
  252.   10.3  Redirection 3xx .............................................61
  253.   10.3.1  300 Multiple Choices .....................................61
  254.   10.3.2  301 Moved Permanently ....................................62
  255.   10.3.3  302 Found ................................................62
  256.   10.3.4  303 See Other ............................................63
  257.   10.3.5  304 Not Modified .........................................63
  258.   10.3.6  305 Use Proxy ............................................64
  259.   10.3.7  306 (Unused) .............................................64
  260.   10.3.8  307 Temporary Redirect ...................................65
  261.   10.4  Client Error 4xx ............................................65
  262.   10.4.1    400 Bad Request .........................................65
  263.   10.4.2    401 Unauthorized ........................................66
  264.   10.4.3    402 Payment Required ....................................66
  265.   10.4.4    403 Forbidden ...........................................66
  266.   10.4.5    404 Not Found ...........................................66
  267.   10.4.6    405 Method Not Allowed ..................................66
  268.   10.4.7    406 Not Acceptable ......................................67
  269.   10.4.8    407 Proxy Authentication Required .......................67
  270.   10.4.9    408 Request Timeout .....................................67
  271.   10.4.10  409 Conflict ............................................67
  272.   10.4.11  410 Gone ................................................68
  273.   10.4.12  411 Length Required .....................................68
  274.   10.4.13  412 Precondition Failed .................................68
  275.   10.4.14  413 Request Entity Too Large ............................69
  276.   10.4.15  414 Request-URI Too Long ................................69
  277.   10.4.16  415 Unsupported Media Type ..............................69
  278.   10.4.17  416 Requested Range Not Satisfiable .....................69
  279.   10.4.18  417 Expectation Failed ..................................70
  280.   10.5  Server Error 5xx ............................................70
  281.   10.5.1  500 Internal Server Error ................................70
  282.   10.5.2  501 Not Implemented ......................................70
  283.   10.5.3  502 Bad Gateway ..........................................70
  284.   10.5.4  503 Service Unavailable ..................................70
  285.   10.5.5  504 Gateway Timeout ......................................71
  286.   10.5.6  505 HTTP Version Not Supported ...........................71
  287. */   
  288.    
  289.    
  290.    
  291. }
  292. // namespace System.Net

Developer Fusion