Updates protocol/know-your-http.md

Auto commit by GitBook Editor
This commit is contained in:
apidesigner
2017-02-02 14:59:50 +00:00
parent 07038705a8
commit 108b7a8779
3 changed files with 41 additions and 1 deletions

View File

@@ -1 +1,40 @@
# Use Appropriate Status Codes
Every API MUST use the appropriate [HTTP Status Codes](https://github.com/for-GET/know-your-http-well/blob/master/status-codes.md) to communicate the result of a request operation.
Every API designer, implementer and consumer MUST understand the semantic of the HTTP Status Code she is using.
At a minimum everyone MUST be familiar with the semantics of ["Common" HTTP Status Codes](https://github.com/for-GET/know-your-http-well/blob/master/status-codes.md#common).
---
#### Example
A request:
```
GET /order/1234 HTTP/1.1
...
```
resulting in the **200 OK** response, when the requested resource (as identified by the request URI) couldn't be found:
```
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"code": "NOT_FOUND_ERR_CODE"
"message" "Order 1234 wasn't found"
}
```
is **illegal**.
Instead the
```
HTTP/1.1 404 Not Found
...
```
should be returned.