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