http_codes.liq 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. # List of HTTP codes. Stolen from en.wikipedia.org..
  2. # List of HTTP response codes and statuses.
  3. # @category Interaction
  4. def http_codes = [
  5. ("100","Continue"),
  6. #This means that the server has received the request headers, and that the client
  7. #should proceed to send the request body (in the case of a request for which a
  8. #body needs to be sent; for example, a POST request). If the request body is
  9. #large, sending it to a server when a request has already been rejected based
  10. #upon inappropriate headers is inefficient. To have a server check if the request
  11. #could be accepted based on the request's headers alone, a client must send
  12. #Expect: 100-continue as a header in its initial request and check if a 100
  13. #Continue status code is received in response before continuing (or receive 417
  14. #Expectation Failed and not continue).
  15. ("101","Switching Protocols"),
  16. #This means the requester has asked the server to switch protocols and the server
  17. #is acknowledging that it will do so.
  18. ("102","Processing"),
  19. #As a WebDAV request may contain many sub-requests involving file operations, it
  20. #may take a long time to complete the request. This code indicates that the
  21. #server has received and is processing the request, but no response is available
  22. #yet. This prevents the client from timing out and assuming the request was
  23. #lost.
  24. ("122","Request-URI too long"),
  25. #This is a non-standard IE7-only code which means the URI is longer than a
  26. #maximum of 2083 characters. (See code 414.),
  27. #2xx Success
  28. #This class of status codes indicates the action requested by the client was
  29. #received, understood, accepted and processed successfully.
  30. ("200","OK"),
  31. #Standard response for successful HTTP requests. The actual response will depend
  32. #on the request method used. In a GET request, the response will contain an
  33. #entity corresponding to the requested resource. In a POST request the response
  34. #will contain an entity describing or containing the result of the action.
  35. ("201","Created"),
  36. #The request has been fulfilled and resulted in a new resource being created.
  37. ("202","Accepted"),
  38. #The request has been accepted for processing, but the processing has not been
  39. #completed. The request might or might not eventually be acted upon, as it might
  40. #be disallowed when processing actually takes place.
  41. ("203","Non-Authoritative Information"),
  42. #The server successfully processed the request, but is returning information that
  43. #may be from another source.
  44. ("204","No Content"),
  45. #The server successfully processed the request, but is not returning any
  46. #content.
  47. ("205","Reset Content"),
  48. #The server successfully processed the request, but is not returning any content.
  49. #Unlike a 204 response, this response requires that the requester reset the
  50. #document view.
  51. ("206","Partial Content"),
  52. #The server is delivering only part of the resource due to a range header sent by
  53. #the client. The range header is used by tools like wget to enable resuming of
  54. #interrupted downloads, or split a download into multiple simultaneous
  55. #streams.
  56. ("207","Multi-Status"),
  57. #The message body that follows is an XML message and can contain a number of
  58. #separate response codes, depending on how many sub-requests were made.
  59. ("226","IM Used"),
  60. #The server has fulfilled a GET request for the resource, and the response is a
  61. #representation of the result of one or more instance-manipulations applied to
  62. #the current instance.
  63. #3xx Redirection
  64. #The client must take additional action to complete the request.
  65. #This class of status code indicates that further action needs to be taken by the
  66. #user agent in order to fulfil the request. The action required may be carried
  67. #out by the user agent without interaction with the user if and only if the
  68. #method used in the second request is GET or HEAD. A user agent should not
  69. #automatically redirect a request more than five times, since such redirections
  70. #usually indicate an infinite loop.
  71. ("300","Multiple Choices"),
  72. #Indicates multiple options for the resource that the client may follow. It, for
  73. #instance, could be used to present different format options for video, list
  74. #files with different extensions, or word sense disambiguation.
  75. ("301","Moved Permanently"),
  76. #This and all future requests should be directed to the given URI.
  77. ("302","Found"),
  78. #This is an example of industrial practice contradicting the standard.
  79. #HTTP/1.0 specification (RFC 1945) required the client to perform a temporary
  80. #redirect (the original describing phrase was "Moved Temporarily"), but
  81. #popular browsers implemented 302 with the functionality of a 303 See Other.
  82. #Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the
  83. #two behaviours. However, the majority of Web applications and frameworks
  84. #still[as of?] use the 302 status code as if it were the 303.[citation needed]
  85. ("303","See Other"),
  86. #The response to the request can be found under another URI using a GET method.
  87. #When received in response to a POST (or PUT/DELETE), it should be assumed that
  88. #the server has received the data and the redirect should be issued with a
  89. #separate GET message.
  90. ("304","Not Modified"),
  91. #Indicates the resource has not been modified since last requested. Typically,
  92. #the HTTP client provides a header like the If-Modified-Since header to provide a
  93. #time against which to compare. Using this saves bandwidth and reprocessing on
  94. #both the server and client, as only the header data must be sent and received in
  95. #comparison to the entirety of the page being re-processed by the server, then
  96. #sent again using more bandwidth of the server and client.
  97. ("305","Use Proxy"),
  98. #Many HTTP clients (such as Mozilla and Internet Explorer) do not correctly
  99. #handle responses with this status code, primarily for security reasons.
  100. ("306","Switch Proxy"),
  101. #No longer used.
  102. ("307","Temporary Redirect"),
  103. #In this occasion, the request should be repeated with another URI, but future
  104. #requests can still use the original URI. In contrast to 303, the request
  105. #method should not be changed when reissuing the original request. For instance,
  106. #a POST request must be repeated using another POST request.
  107. #4xx Client Error
  108. #The 4xx class of status code is intended for cases in which the client seems to
  109. #have erred. Except when responding to a HEAD request, the server should include
  110. #an entity containing an explanation of the error situation, and whether it is a
  111. #temporary or permanent condition. These status codes are applicable to any
  112. #request method. User agents should display any included entity to the user.
  113. #These are typically the most common error codes encountered while online.
  114. ("400","Bad Request"),
  115. #The request cannot be fulfilled due to bad syntax.
  116. ("401","Unauthorized"),
  117. #Similar to 403 Forbidden, but specifically for use when authentication is
  118. #possible but has failed or not yet been provided. The response must include a
  119. #WWW-Authenticate header field containing a challenge applicable to the requested
  120. #resource. See Basic access authentication and Digest access authentication.
  121. ("402","Payment Required"),
  122. #Reserved for future use. The original intention was that this code might be
  123. #used as part of some form of digital cash or micropayment scheme, but that has
  124. #not happened, and this code is not usually used. As an example of its use,
  125. #however, Apple's MobileMe service generates a 402 error ("httpStatusCode:402" in
  126. #the Mac OS X Console log) if the MobileMe account is delinquent.
  127. ("403","Forbidden"),
  128. #The request was a legal request, but the server is refusing to respond to it.
  129. #Unlike a 401 Unauthorized response, authenticating will make no difference.
  130. ("404","Not Found"),
  131. #The requested resource could not be found but may be available again in the
  132. #future. Subsequent requests by the client are permissible.
  133. ("405","Method Not Allowed"),
  134. #A request was made of a resource using a request method not supported by that
  135. #resource; for example, using GET on a form which requires data to be
  136. #presented via POST, or using PUT on a read-only resource.
  137. ("406","Not Acceptable"),
  138. #The requested resource is only capable of generating content not acceptable
  139. #according to the Accept headers sent in the request.
  140. ("407","Proxy Authentication Required"),
  141. ("408","Request Timeout"),
  142. #The server timed out waiting for the request. According to W3 HTTP
  143. #specifications: "The client did not produce a request within the time that the
  144. #server was prepared to wait. The client MAY repeat the request without
  145. #modifications at any later time."
  146. ("409","Conflict"),
  147. #Indicates that the request could not be processed because of conflict in the
  148. #request, such as an edit conflict.
  149. ("410","Gone"),
  150. #Indicates that the resource requested is no longer available and will not be
  151. #available again. This should be used when a resource has been intentionally
  152. #removed and the resource should be purged. Upon receiving a 410 status code, the
  153. #client should not request the resource again in the future. Clients such as
  154. #search engines should remove the resource from their indices. Most use cases do
  155. #not require clients and search engines to purge the resource, and a "404 Not
  156. #Found" may be used instead.
  157. ("411","Length Required"),
  158. #The request did not specify the length of its content, which is required by the
  159. #requested resource.
  160. ("412","Precondition Failed"),
  161. #The server does not meet one of the preconditions that the requester put on the
  162. #request.
  163. ("413","Request Entity Too Large"),
  164. #The request is larger than the server is willing or able to process.
  165. ("414","Request-URI Too Long"),
  166. #The URI provided was too long for the server to process.
  167. ("415","Unsupported Media Type"),
  168. #The request entity has a media type which the server or resource does not
  169. #support. For example, the client uploads an image as image/svg+xml, but the
  170. #server requires that images use a different format.
  171. ("416","Requested Range Not Satisfiable"),
  172. #The client has asked for a portion of the file, but the server cannot supply
  173. #that portion. For example, if the client asked for a part of the file that
  174. #lies beyond the end of the file.
  175. ("417","Expectation Failed"),
  176. #The server cannot meet the requirements of the Expect request-header field.
  177. ("418","I'm a teapot"),
  178. #This code was defined in 1998 as one of the traditional IETF April Fools' jokes,
  179. #in RFC 2324, Hyper Text Coffee Pot Control Protocol, and is not expected to be
  180. #implemented by actual HTTP servers.
  181. ("422","Unprocessable Entity"),
  182. #The request was well-formed but was unable to be followed due to semantic
  183. #errors.
  184. ("423","Locked"),
  185. #The resource that is being accessed is locked.
  186. ("424","Failed Dependency"),
  187. #The request failed due to failure of a previous request (e.g. a PROPPATCH).
  188. ("425","Unordered Collection"),
  189. #Defined in drafts of "WebDAV Advanced Collections Protocol", but not present
  190. #in "Web Distributed Authoring and Versioning (WebDAV) Ordered Collections
  191. #Protocol".
  192. ("426","Upgrade Required"),
  193. #The client should switch to a different protocol such as TLS/1.0.
  194. ("444","No Response"),
  195. #A Nginx HTTP server extension. The server returns no information to the client
  196. #and closes the connection (useful as a deterrent for malware).
  197. ("449","Retry With"),
  198. #A Microsoft extension. The request should be retried after performing the
  199. #appropriate action.
  200. ("450","Blocked by Windows Parental Controls"),
  201. #A Microsoft extension. This error is given when Windows Parental Controls are
  202. #turned on and are blocking access to the given webpage.
  203. ("499","Client Closed Request"),
  204. #An Nginx HTTP server extension. This code is introduced to log the case when the
  205. #connection is closed by client while HTTP server is processing its request,
  206. #making server unable to send the HTTP header back.
  207. #5xx Server Error
  208. #The server failed to fulfill an apparently valid request.
  209. #Response status codes beginning with the digit "5" indicate cases in which the
  210. #server is aware that it has encountered an error or is otherwise incapable of
  211. #performing the request. Except when responding to a HEAD request, the server
  212. #should include an entity containing an explanation of the error situation, and
  213. #indicate whether it is a temporary or permanent condition. Likewise, user agents
  214. #should display any included entity to the user. These response codes are
  215. #applicable to any request method.
  216. ("500","Internal Server Error"),
  217. #A generic error message, given when no more specific message is suitable.
  218. ("501","Not Implemented"),
  219. #The server either does not recognise the request method, or it lacks the ability
  220. #to fulfill the request.
  221. ("502","Bad Gateway"),
  222. #The server was acting as a gateway or proxy and received an invalid response
  223. #from the upstream server.
  224. ("503","Service Unavailable"),
  225. #The server is currently unavailable (because it is overloaded or down for
  226. #maintenance). Generally, this is a temporary state.
  227. ("504","Gateway Timeout"),
  228. #The server was acting as a gateway or proxy and did not receive a timely
  229. #response from the upstream server.
  230. ("505","HTTP Version Not Supported"),
  231. #The server does not support the HTTP protocol version used in the request.
  232. ("506","Variant Also Negotiates"),
  233. #Transparent content negotiation for the request results in a circular
  234. #reference.
  235. ("507","Insufficient Storage"),
  236. ("509","Bandwidth Limit Exceeded"),
  237. #This status code, while used by many servers, is not specified in any RFCs.
  238. ("510","Not Extended")
  239. #Further extensions to the request are required for the server to fulfill it.
  240. ]
  241. end