1
0

OSHttpStatusCodes.cs 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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
  31. /// http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
  32. /// </summary>
  33. public enum OSHttpStatusCode: int
  34. {
  35. // 1xx Informational status codes providing a provisional
  36. // response.
  37. // 100 Tells client that to keep on going sending its request
  38. InfoContinue = 100,
  39. // 101 Server understands request, proposes to switch to different
  40. // application level protocol
  41. InfoSwitchingProtocols = 101,
  42. // 2xx Success codes
  43. // 200 Request successful
  44. SuccessOk = 200,
  45. // 201 Request successful, new resource created
  46. SuccessOkCreated = 201,
  47. // 202 Request accepted, processing still on-going
  48. SuccessOkAccepted = 202,
  49. // 203 Request successful, meta information not authoritative
  50. SuccessOkNonAuthoritativeInformation = 203,
  51. // 204 Request successful, nothing to return in the body
  52. SuccessOkNoContent = 204,
  53. // 205 Request successful, reset displayed content
  54. SuccessOkResetContent = 205,
  55. // 206 Request successful, partial content returned
  56. SuccessOkPartialContent = 206,
  57. // 3xx Redirect code: user agent needs to go somewhere else
  58. // 300 Redirect: different presentation forms available, take
  59. // a pick
  60. RedirectMultipleChoices = 300,
  61. // 301 Redirect: requested resource has moved and now lives
  62. // somewhere else
  63. RedirectMovedPermanently = 301,
  64. // 302 Redirect: Resource temporarily somewhere else, location
  65. // might change
  66. RedirectFound = 302,
  67. // 303 Redirect: See other as result of a POST
  68. RedirectSeeOther = 303,
  69. // 304 Redirect: Resource still the same as before
  70. RedirectNotModified = 304,
  71. // 305 Redirect: Resource must be accessed via proxy provided
  72. // in location field
  73. RedirectUseProxy = 305,
  74. // 307 Redirect: Resource temporarily somewhere else, location
  75. // might change
  76. RedirectMovedTemporarily = 307,
  77. // 4xx Client error: the client borked the request
  78. // 400 Client error: bad request, server does not grok what
  79. // the client wants
  80. ClientErrorBadRequest = 400,
  81. // 401 Client error: the client is not authorized, response
  82. // provides WWW-Authenticate header field with a challenge
  83. ClientErrorUnauthorized = 401,
  84. // 402 Client error: Payment required (reserved for future use)
  85. ClientErrorPaymentRequired = 402,
  86. // 403 Client error: Server understood request, will not
  87. // deliver, do not try again.
  88. ClientErrorForbidden = 403,
  89. // 404 Client error: Server cannot find anything matching the
  90. // client request.
  91. ClientErrorNotFound = 404,
  92. // 405 Client error: The method specified by the client in the
  93. // request is not allowed for the resource requested
  94. ClientErrorMethodNotAllowed = 405,
  95. // 406 Client error: Server cannot generate suitable response
  96. // for the resource and content characteristics requested by
  97. // the client
  98. ClientErrorNotAcceptable = 406,
  99. // 407 Client error: Similar to 401, Server requests that
  100. // client authenticate itself with the proxy first
  101. ClientErrorProxyAuthRequired = 407,
  102. // 408 Client error: Server got impatient with client and
  103. // decided to give up waiting for the client's request to
  104. // arrive
  105. ClientErrorRequestTimeout = 408,
  106. // 409 Client error: Server could not fulfill the request for
  107. // a resource as there is a conflict with the current state of
  108. // the resource but thinks client can do something about this
  109. ClientErrorConflict = 409,
  110. // 410 Client error: The resource has moved somewhere else,
  111. // but server has no clue where.
  112. ClientErrorGone = 410,
  113. // 411 Client error: The server is picky again and insists on
  114. // having a content-length header field in the request
  115. ClientErrorLengthRequired = 411,
  116. // 412 Client error: one or more preconditions supplied in the
  117. // client's request is false
  118. ClientErrorPreconditionFailed = 412,
  119. // 413 Client error: For fear of reflux, the server refuses to
  120. // swallow that much data.
  121. ClientErrorRequestEntityToLarge = 413,
  122. // 414 Client error: The server considers the Request-URI to
  123. // be indecently long and refuses to even look at it.
  124. ClientErrorRequestURITooLong = 414,
  125. // 415 Client error: The server has no clue about the media
  126. // type requested by the client (contrary to popular belief it
  127. // is not a warez server)
  128. ClientErrorUnsupportedMediaType = 415,
  129. // 416 Client error: The requested range cannot be delivered
  130. // by the server.
  131. ClientErrorRequestRangeNotSatisfiable = 416,
  132. // 417 Client error: The expectations of the client as
  133. // expressed in one or more Expect header fields cannot be met
  134. // by the server, the server is awfully sorry about this.
  135. ClientErrorExpectationFailed = 417,
  136. // 499 Client error: Wildcard error.
  137. ClientErrorJoker = 499,
  138. // 5xx Server errors (rare)
  139. // 500 Server error: something really strange and unexpected
  140. // happened
  141. ServerErrorInternalError = 500,
  142. // 501 Server error: The server does not do the functionality
  143. // required to carry out the client request. not at
  144. // all. certainly not before breakfast. but also not after
  145. // breakfast.
  146. ServerErrorNotImplemented = 501,
  147. // 502 Server error: While acting as a proxy or a gateway, the
  148. // server got ditched by the upstream server and as a
  149. // consequence regretfully cannot fulfill the client's request
  150. ServerErrorBadGateway = 502,
  151. // 503 Server error: Due to unforseen circumstances the server
  152. // cannot currently deliver the service requested. Retry-After
  153. // header might indicate when to try again.
  154. ServerErrorServiceUnavailable = 503,
  155. // 504 Server error: The server blames the upstream server
  156. // for not being able to deliver the service requested and
  157. // claims that the upstream server is too slow delivering the
  158. // goods.
  159. ServerErrorGatewayTimeout = 504,
  160. // 505 Server error: The server does not support the HTTP
  161. // version conveyed in the client's request.
  162. ServerErrorHttpVersionNotSupported = 505,
  163. }
  164. }