http_status_codes.asciidoc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. = HTTP status codes(7)
  2. == Name
  3. HTTP status codes - status codes used by Cowboy
  4. == Description
  5. This chapter aims to list all HTTP status codes that Cowboy
  6. may return, with details on the reasons why. The list given
  7. here only includes the replies that Cowboy sends, not user
  8. replies.
  9. == 100 Continue
  10. When the client sends an `expect: 100-continue` header,
  11. Cowboy automatically sends a this status code before
  12. trying to read the request body. This behavior can be
  13. disabled using the appropriate body option.
  14. == 101 Switching Protocols
  15. This is the status code sent when switching to the
  16. Websocket protocol.
  17. == 200 OK
  18. This status code is sent by `cowboy_rest`.
  19. == 201 Created
  20. This status code is sent by `cowboy_rest`.
  21. == 202 Accepted
  22. This status code is sent by `cowboy_rest`.
  23. == 204 No Content
  24. This status code is sent when the processing of a request
  25. ends without any reply having been sent. It may also be
  26. sent by `cowboy_rest` under normal conditions.
  27. == 300 Multiple Choices
  28. This status code is sent by `cowboy_rest`.
  29. == 301 Moved Permanently
  30. This status code is sent by `cowboy_rest`.
  31. == 303 See Other
  32. This status code is sent by `cowboy_rest`.
  33. == 304 Not Modified
  34. This status code is sent by `cowboy_rest`.
  35. == 307 Temporary Redirect
  36. This status code is sent by `cowboy_rest`.
  37. == 400 Bad Request
  38. Cowboy will send this status code for any of the
  39. following reasons:
  40. * Too many empty lines were sent before the request.
  41. * The request-line could not be parsed.
  42. * Too many headers were sent.
  43. * A header name was too long.
  44. * A header value was too long.
  45. * The host header was missing from an HTTP/1.1 request.
  46. * The host header could not be parsed.
  47. * The requested host was not found.
  48. * The requested path could not be parsed.
  49. * The accept header could not be parsed when using REST.
  50. * REST under normal conditions.
  51. * A Websocket upgrade failed.
  52. == 401 Unauthorized
  53. This status code is sent by `cowboy_rest`.
  54. == 403 Forbidden
  55. This status code is sent by `cowboy_rest`.
  56. == 404 Not Found
  57. This status code is sent when the router successfully
  58. resolved the host but didn't find a matching path for
  59. the request. It may also be sent by `cowboy_rest` under
  60. normal conditions.
  61. == 405 Method Not Allowed
  62. This status code is sent by `cowboy_rest`.
  63. == 406 Not Acceptable
  64. This status code is sent by `cowboy_rest`.
  65. == 408 Request Timeout
  66. Cowboy will send this status code to the client if the
  67. client started to send a request, indicated by the
  68. request-line being received fully, but failed to send
  69. all headers in a reasonable time.
  70. == 409 Conflict
  71. This status code is sent by `cowboy_rest`.
  72. == 410 Gone
  73. This status code is sent by `cowboy_rest`.
  74. == 412 Precondition Failed
  75. This status code is sent by `cowboy_rest`.
  76. == 413 Request Entity Too Large
  77. This status code is sent by `cowboy_rest`.
  78. == 414 Request-URI Too Long
  79. Cowboy will send this status code to the client if the
  80. request-line is too long. It may also be sent by
  81. `cowboy_rest` under normal conditions.
  82. == 415 Unsupported Media Type
  83. This status code is sent by `cowboy_rest`.
  84. == 500 Internal Server Error
  85. This status code is sent when a crash occurs in HTTP, loop
  86. or REST handlers, or when an invalid return value is
  87. returned. It may also be sent by `cowboy_rest` under
  88. normal conditions.
  89. == 501 Not Implemented
  90. This status code is sent by `cowboy_rest`.
  91. == 503 Service Unavailable
  92. This status code is sent by `cowboy_rest`.
  93. == 505 HTTP Version Not Supported
  94. Cowboy only supports the versions 1.0 and 1.1 of HTTP.
  95. In all other cases this status code is sent back to the
  96. client and the connection is closed.