OSHttpStatusCodes.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. namespace OpenSim.Framework.Servers.HttpServer
  28. {
  29. /// <summary>
  30. /// HTTP status codes (almost) as defined by W3C in http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html and IETF in http://tools.ietf.org/html/rfc6585
  31. /// </summary>
  32. public enum OSHttpStatusCode : int
  33. {
  34. #region 1xx Informational status codes providing a provisional response.
  35. /// <summary>
  36. /// 100 Tells client that to keep on going sending its request
  37. /// </summary>
  38. InfoContinue = 100,
  39. /// <summary>
  40. /// 101 Server understands request, proposes to switch to different application level protocol
  41. /// </summary>
  42. InfoSwitchingProtocols = 101,
  43. #endregion
  44. #region 2xx Success codes
  45. /// <summary>
  46. /// 200 Request successful
  47. /// </summary>
  48. SuccessOk = 200,
  49. /// <summary>
  50. /// 201 Request successful, new resource created
  51. /// </summary>
  52. SuccessOkCreated = 201,
  53. /// <summary>
  54. /// 202 Request accepted, processing still on-going
  55. /// </summary>
  56. SuccessOkAccepted = 202,
  57. /// <summary>
  58. /// 203 Request successful, meta information not authoritative
  59. /// </summary>
  60. SuccessOkNonAuthoritativeInformation = 203,
  61. /// <summary>
  62. /// 204 Request successful, nothing to return in the body
  63. /// </summary>
  64. SuccessOkNoContent = 204,
  65. /// <summary>
  66. /// 205 Request successful, reset displayed content
  67. /// </summary>
  68. SuccessOkResetContent = 205,
  69. /// <summary>
  70. /// 206 Request successful, partial content returned
  71. /// </summary>
  72. SuccessOkPartialContent = 206,
  73. #endregion
  74. #region 3xx Redirect code: user agent needs to go somewhere else
  75. /// <summary>
  76. /// 300 Redirect: different presentation forms available, take a pick
  77. /// </summary>
  78. RedirectMultipleChoices = 300,
  79. /// <summary>
  80. /// 301 Redirect: requested resource has moved and now lives somewhere else
  81. /// </summary>
  82. RedirectMovedPermanently = 301,
  83. /// <summary>
  84. /// 302 Redirect: Resource temporarily somewhere else, location might change
  85. /// </summary>
  86. RedirectFound = 302,
  87. /// <summary>
  88. /// 303 Redirect: See other as result of a POST
  89. /// </summary>
  90. RedirectSeeOther = 303,
  91. /// <summary>
  92. /// 304 Redirect: Resource still the same as before
  93. /// </summary>
  94. RedirectNotModified = 304,
  95. /// <summary>
  96. /// 305 Redirect: Resource must be accessed via proxy provided in location field
  97. /// </summary>
  98. RedirectUseProxy = 305,
  99. /// <summary>
  100. /// 307 Redirect: Resource temporarily somewhere else, location might change
  101. /// </summary>
  102. RedirectMovedTemporarily = 307,
  103. #endregion
  104. #region 4xx Client error: the client borked the request
  105. /// <summary>
  106. /// 400 Client error: bad request, server does not grok what the client wants
  107. /// </summary>
  108. ClientErrorBadRequest = 400,
  109. /// <summary>
  110. /// 401 Client error: the client is not authorized, response provides WWW-Authenticate header field with a challenge
  111. /// </summary>
  112. ClientErrorUnauthorized = 401,
  113. /// <summary>
  114. /// 402 Client error: Payment required (reserved for future use)
  115. /// </summary>
  116. ClientErrorPaymentRequired = 402,
  117. /// <summary>
  118. /// 403 Client error: Server understood request, will not deliver, do not try again.
  119. ClientErrorForbidden = 403,
  120. /// <summary>
  121. /// 404 Client error: Server cannot find anything matching the client request.
  122. /// </summary>
  123. ClientErrorNotFound = 404,
  124. /// <summary>
  125. /// 405 Client error: The method specified by the client in the request is not allowed for the resource requested
  126. /// </summary>
  127. ClientErrorMethodNotAllowed = 405,
  128. /// <summary>
  129. /// 406 Client error: Server cannot generate suitable response for the resource and content characteristics requested by the client
  130. /// </summary>
  131. ClientErrorNotAcceptable = 406,
  132. /// <summary>
  133. /// 407 Client error: Similar to 401, Server requests that client authenticate itself with the proxy first
  134. /// </summary>
  135. ClientErrorProxyAuthRequired = 407,
  136. /// <summary>
  137. /// 408 Client error: Server got impatient with client and decided to give up waiting for the client's request to arrive
  138. /// </summary>
  139. ClientErrorRequestTimeout = 408,
  140. /// <summary>
  141. /// 409 Client error: Server could not fulfill the request for a resource as there is a conflict with the current state of the resource but thinks client can do something about this
  142. /// </summary>
  143. ClientErrorConflict = 409,
  144. /// <summary>
  145. /// 410 Client error: The resource has moved somewhere else, but server has no clue where.
  146. /// </summary>
  147. ClientErrorGone = 410,
  148. /// <summary>
  149. /// 411 Client error: The server is picky again and insists on having a content-length header field in the request
  150. /// </summary>
  151. ClientErrorLengthRequired = 411,
  152. /// <summary>
  153. /// 412 Client error: one or more preconditions supplied in the client's request is false
  154. /// </summary>
  155. ClientErrorPreconditionFailed = 412,
  156. /// <summary>
  157. /// 413 Client error: For fear of reflux, the server refuses to swallow that much data.
  158. /// </summary>
  159. ClientErrorRequestEntityToLarge = 413,
  160. /// <summary>
  161. /// 414 Client error: The server considers the Request-URI to be indecently long and refuses to even look at it.
  162. /// </summary>
  163. ClientErrorRequestURITooLong = 414,
  164. /// <summary>
  165. /// 415 Client error: The server has no clue about the media type requested by the client (contrary to popular belief it is not a warez server)
  166. /// </summary>
  167. ClientErrorUnsupportedMediaType = 415,
  168. /// <summary>
  169. /// 416 Client error: The requested range cannot be delivered by the server.
  170. /// </summary>
  171. ClientErrorRequestRangeNotSatisfiable = 416,
  172. /// <summary>
  173. /// 417 Client error: The expectations of the client as expressed in one or more Expect header fields cannot be met by the server, the server is awfully sorry about this.
  174. /// </summary>
  175. ClientErrorExpectationFailed = 417,
  176. /// <summary>
  177. /// 428 Client error :The 428 status code indicates that the origin server requires the request to be conditional.
  178. /// </summary>
  179. ClientErrorPreconditionRequired = 428,
  180. /// <summary>
  181. /// 429 Client error: The 429 status code indicates that the user has sent too many requests in a given amount of time ("rate limiting").
  182. /// </summary>
  183. ClientErrorTooManyRequests = 429,
  184. /// <summary>
  185. /// 431 Client error: The 431 status code indicates that the server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.
  186. /// </summary>
  187. ClientErrorRequestHeaderFieldsTooLarge = 431,
  188. /// <summary>
  189. /// 499 Client error: Wildcard error.
  190. /// </summary>
  191. ClientErrorJoker = 499,
  192. #endregion
  193. #region 5xx Server errors (rare)
  194. /// <summary>
  195. /// 500 Server error: something really strange and unexpected happened
  196. /// </summary>
  197. ServerErrorInternalError = 500,
  198. /// <summary>
  199. /// 501 Server error: The server does not do the functionality required to carry out the client request. not at all. certainly not before breakfast. but also not after breakfast.
  200. /// </summary>
  201. ServerErrorNotImplemented = 501,
  202. /// <summary>
  203. /// 502 Server error: While acting as a proxy or a gateway, the server got ditched by the upstream server and as a consequence regretfully cannot fulfill the client's request
  204. /// </summary>
  205. ServerErrorBadGateway = 502,
  206. /// <summary>
  207. /// 503 Server error: Due to unforseen circumstances the server cannot currently deliver the service requested. Retry-After header might indicate when to try again.
  208. /// </summary>
  209. ServerErrorServiceUnavailable = 503,
  210. /// <summary>
  211. /// 504 Server error: The server blames the upstream server for not being able to deliver the service requested and claims that the upstream server is too slow delivering the goods.
  212. /// </summary>
  213. ServerErrorGatewayTimeout = 504,
  214. /// <summary>
  215. /// 505 Server error: The server does not support the HTTP version conveyed in the client's request.
  216. /// </summary>
  217. ServerErrorHttpVersionNotSupported = 505,
  218. /// <summary>
  219. /// 511 Server error: The 511 status code indicates that the client needs to authenticate to gain network access.
  220. /// </summary>
  221. ServerErrorNetworkAuthenticationRequired = 511,
  222. #endregion
  223. }
  224. }