2
0

HttpStatusCode.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. namespace SocketHttpListener.Net
  2. {
  3. /// <summary>
  4. /// Contains the values of the HTTP status codes.
  5. /// </summary>
  6. /// <remarks>
  7. /// The HttpStatusCode enumeration contains the values of the HTTP status codes defined in
  8. /// <see href="http://tools.ietf.org/html/rfc2616#section-10">RFC 2616</see> for HTTP 1.1.
  9. /// </remarks>
  10. public enum HttpStatusCode
  11. {
  12. /// <summary>
  13. /// Equivalent to status code 100.
  14. /// Indicates that the client should continue with its request.
  15. /// </summary>
  16. Continue = 100,
  17. /// <summary>
  18. /// Equivalent to status code 101.
  19. /// Indicates that the server is switching the HTTP version or protocol on the connection.
  20. /// </summary>
  21. SwitchingProtocols = 101,
  22. /// <summary>
  23. /// Equivalent to status code 200.
  24. /// Indicates that the client's request has succeeded.
  25. /// </summary>
  26. OK = 200,
  27. /// <summary>
  28. /// Equivalent to status code 201.
  29. /// Indicates that the client's request has been fulfilled and resulted in a new resource being
  30. /// created.
  31. /// </summary>
  32. Created = 201,
  33. /// <summary>
  34. /// Equivalent to status code 202.
  35. /// Indicates that the client's request has been accepted for processing, but the processing
  36. /// hasn't been completed.
  37. /// </summary>
  38. Accepted = 202,
  39. /// <summary>
  40. /// Equivalent to status code 203.
  41. /// Indicates that the returned metainformation is from a local or a third-party copy instead of
  42. /// the origin server.
  43. /// </summary>
  44. NonAuthoritativeInformation = 203,
  45. /// <summary>
  46. /// Equivalent to status code 204.
  47. /// Indicates that the server has fulfilled the client's request but doesn't need to return
  48. /// an entity-body.
  49. /// </summary>
  50. NoContent = 204,
  51. /// <summary>
  52. /// Equivalent to status code 205.
  53. /// Indicates that the server has fulfilled the client's request, and the user agent should
  54. /// reset the document view which caused the request to be sent.
  55. /// </summary>
  56. ResetContent = 205,
  57. /// <summary>
  58. /// Equivalent to status code 206.
  59. /// Indicates that the server has fulfilled the partial GET request for the resource.
  60. /// </summary>
  61. PartialContent = 206,
  62. /// <summary>
  63. /// <para>
  64. /// Equivalent to status code 300.
  65. /// Indicates that the requested resource corresponds to any of multiple representations.
  66. /// </para>
  67. /// <para>
  68. /// MultipleChoices is a synonym for Ambiguous.
  69. /// </para>
  70. /// </summary>
  71. MultipleChoices = 300,
  72. /// <summary>
  73. /// <para>
  74. /// Equivalent to status code 300.
  75. /// Indicates that the requested resource corresponds to any of multiple representations.
  76. /// </para>
  77. /// <para>
  78. /// Ambiguous is a synonym for MultipleChoices.
  79. /// </para>
  80. /// </summary>
  81. Ambiguous = 300,
  82. /// <summary>
  83. /// <para>
  84. /// Equivalent to status code 301.
  85. /// Indicates that the requested resource has been assigned a new permanent URI and
  86. /// any future references to this resource should use one of the returned URIs.
  87. /// </para>
  88. /// <para>
  89. /// MovedPermanently is a synonym for Moved.
  90. /// </para>
  91. /// </summary>
  92. MovedPermanently = 301,
  93. /// <summary>
  94. /// <para>
  95. /// Equivalent to status code 301.
  96. /// Indicates that the requested resource has been assigned a new permanent URI and
  97. /// any future references to this resource should use one of the returned URIs.
  98. /// </para>
  99. /// <para>
  100. /// Moved is a synonym for MovedPermanently.
  101. /// </para>
  102. /// </summary>
  103. Moved = 301,
  104. /// <summary>
  105. /// <para>
  106. /// Equivalent to status code 302.
  107. /// Indicates that the requested resource is located temporarily under a different URI.
  108. /// </para>
  109. /// <para>
  110. /// Found is a synonym for Redirect.
  111. /// </para>
  112. /// </summary>
  113. Found = 302,
  114. /// <summary>
  115. /// <para>
  116. /// Equivalent to status code 302.
  117. /// Indicates that the requested resource is located temporarily under a different URI.
  118. /// </para>
  119. /// <para>
  120. /// Redirect is a synonym for Found.
  121. /// </para>
  122. /// </summary>
  123. Redirect = 302,
  124. /// <summary>
  125. /// <para>
  126. /// Equivalent to status code 303.
  127. /// Indicates that the response to the request can be found under a different URI and
  128. /// should be retrieved using a GET method on that resource.
  129. /// </para>
  130. /// <para>
  131. /// SeeOther is a synonym for RedirectMethod.
  132. /// </para>
  133. /// </summary>
  134. SeeOther = 303,
  135. /// <summary>
  136. /// <para>
  137. /// Equivalent to status code 303.
  138. /// Indicates that the response to the request can be found under a different URI and
  139. /// should be retrieved using a GET method on that resource.
  140. /// </para>
  141. /// <para>
  142. /// RedirectMethod is a synonym for SeeOther.
  143. /// </para>
  144. /// </summary>
  145. RedirectMethod = 303,
  146. /// <summary>
  147. /// Equivalent to status code 304.
  148. /// Indicates that the client has performed a conditional GET request and access is allowed,
  149. /// but the document hasn't been modified.
  150. /// </summary>
  151. NotModified = 304,
  152. /// <summary>
  153. /// Equivalent to status code 305.
  154. /// Indicates that the requested resource must be accessed through the proxy given by
  155. /// the Location field.
  156. /// </summary>
  157. UseProxy = 305,
  158. /// <summary>
  159. /// Equivalent to status code 306.
  160. /// This status code was used in a previous version of the specification, is no longer used,
  161. /// and is reserved for future use.
  162. /// </summary>
  163. Unused = 306,
  164. /// <summary>
  165. /// <para>
  166. /// Equivalent to status code 307.
  167. /// Indicates that the requested resource is located temporarily under a different URI.
  168. /// </para>
  169. /// <para>
  170. /// TemporaryRedirect is a synonym for RedirectKeepVerb.
  171. /// </para>
  172. /// </summary>
  173. TemporaryRedirect = 307,
  174. /// <summary>
  175. /// <para>
  176. /// Equivalent to status code 307.
  177. /// Indicates that the requested resource is located temporarily under a different URI.
  178. /// </para>
  179. /// <para>
  180. /// RedirectKeepVerb is a synonym for TemporaryRedirect.
  181. /// </para>
  182. /// </summary>
  183. RedirectKeepVerb = 307,
  184. /// <summary>
  185. /// Equivalent to status code 400.
  186. /// Indicates that the client's request couldn't be understood by the server due to
  187. /// malformed syntax.
  188. /// </summary>
  189. BadRequest = 400,
  190. /// <summary>
  191. /// Equivalent to status code 401.
  192. /// Indicates that the client's request requires user authentication.
  193. /// </summary>
  194. Unauthorized = 401,
  195. /// <summary>
  196. /// Equivalent to status code 402.
  197. /// This status code is reserved for future use.
  198. /// </summary>
  199. PaymentRequired = 402,
  200. /// <summary>
  201. /// Equivalent to status code 403.
  202. /// Indicates that the server understood the client's request but is refusing to fulfill it.
  203. /// </summary>
  204. Forbidden = 403,
  205. /// <summary>
  206. /// Equivalent to status code 404.
  207. /// Indicates that the server hasn't found anything matching the request URI.
  208. /// </summary>
  209. NotFound = 404,
  210. /// <summary>
  211. /// Equivalent to status code 405.
  212. /// Indicates that the method specified in the request line isn't allowed for the resource
  213. /// identified by the request URI.
  214. /// </summary>
  215. MethodNotAllowed = 405,
  216. /// <summary>
  217. /// Equivalent to status code 406.
  218. /// Indicates that the server doesn't have the appropriate resource to respond to the Accept
  219. /// headers in the client's request.
  220. /// </summary>
  221. NotAcceptable = 406,
  222. /// <summary>
  223. /// Equivalent to status code 407.
  224. /// Indicates that the client must first authenticate itself with the proxy.
  225. /// </summary>
  226. ProxyAuthenticationRequired = 407,
  227. /// <summary>
  228. /// Equivalent to status code 408.
  229. /// Indicates that the client didn't produce a request within the time that the server was
  230. /// prepared to wait.
  231. /// </summary>
  232. RequestTimeout = 408,
  233. /// <summary>
  234. /// Equivalent to status code 409.
  235. /// Indicates that the client's request couldn't be completed due to a conflict on the server.
  236. /// </summary>
  237. Conflict = 409,
  238. /// <summary>
  239. /// Equivalent to status code 410.
  240. /// Indicates that the requested resource is no longer available at the server and
  241. /// no forwarding address is known.
  242. /// </summary>
  243. Gone = 410,
  244. /// <summary>
  245. /// Equivalent to status code 411.
  246. /// Indicates that the server refuses to accept the client's request without a defined
  247. /// Content-Length.
  248. /// </summary>
  249. LengthRequired = 411,
  250. /// <summary>
  251. /// Equivalent to status code 412.
  252. /// Indicates that the precondition given in one or more of the request headers evaluated to
  253. /// false when it was tested on the server.
  254. /// </summary>
  255. PreconditionFailed = 412,
  256. /// <summary>
  257. /// Equivalent to status code 413.
  258. /// Indicates that the entity of the client's request is larger than the server is willing or
  259. /// able to process.
  260. /// </summary>
  261. RequestEntityTooLarge = 413,
  262. /// <summary>
  263. /// Equivalent to status code 414.
  264. /// Indicates that the request URI is longer than the server is willing to interpret.
  265. /// </summary>
  266. RequestUriTooLong = 414,
  267. /// <summary>
  268. /// Equivalent to status code 415.
  269. /// Indicates that the entity of the client's request is in a format not supported by
  270. /// the requested resource for the requested method.
  271. /// </summary>
  272. UnsupportedMediaType = 415,
  273. /// <summary>
  274. /// Equivalent to status code 416.
  275. /// Indicates that none of the range specifier values in a Range request header overlap
  276. /// the current extent of the selected resource.
  277. /// </summary>
  278. RequestedRangeNotSatisfiable = 416,
  279. /// <summary>
  280. /// Equivalent to status code 417.
  281. /// Indicates that the expectation given in an Expect request header couldn't be met by
  282. /// the server.
  283. /// </summary>
  284. ExpectationFailed = 417,
  285. /// <summary>
  286. /// Equivalent to status code 500.
  287. /// Indicates that the server encountered an unexpected condition which prevented it from
  288. /// fulfilling the client's request.
  289. /// </summary>
  290. InternalServerError = 500,
  291. /// <summary>
  292. /// Equivalent to status code 501.
  293. /// Indicates that the server doesn't support the functionality required to fulfill the client's
  294. /// request.
  295. /// </summary>
  296. NotImplemented = 501,
  297. /// <summary>
  298. /// Equivalent to status code 502.
  299. /// Indicates that a gateway or proxy server received an invalid response from the upstream
  300. /// server.
  301. /// </summary>
  302. BadGateway = 502,
  303. /// <summary>
  304. /// Equivalent to status code 503.
  305. /// Indicates that the server is currently unable to handle the client's request due to
  306. /// a temporary overloading or maintenance of the server.
  307. /// </summary>
  308. ServiceUnavailable = 503,
  309. /// <summary>
  310. /// Equivalent to status code 504.
  311. /// Indicates that a gateway or proxy server didn't receive a timely response from the upstream
  312. /// server or some other auxiliary server.
  313. /// </summary>
  314. GatewayTimeout = 504,
  315. /// <summary>
  316. /// Equivalent to status code 505.
  317. /// Indicates that the server doesn't support the HTTP version used in the client's request.
  318. /// </summary>
  319. HttpVersionNotSupported = 505,
  320. }
  321. }