Updates protocol/separate-concerns.md

Auto commit by GitBook Editor
This commit is contained in:
apidesigner
2017-02-02 14:03:46 +00:00
parent 2886cfdb4b
commit fd08ac7b09

View File

@@ -8,7 +8,35 @@ Every API using HTTP/S API MUST clearly follow the concern separation of a HTTP
1. _HTTP message headers_ MUST be used to transfer the **metadata** about the message and its content
1. _URI query parameter_ SHOULD NOT be used to transfer metadata
> NOTE: Rule No.1 means there MUST be NO information about the media type or version of resource in the URI (e.g. `/greeting.json` or `/v2.1.3/greeting` are **illegal**).
#### Example 1
The rule
> A resource identifierURI MUST be used to indicate identity only
implies there MUST be NO information about the media type or version of resource in the URI. For example URIs `/greeting.json` or `/v2.1.3/greeting` are **illegal** as they are not used for identification of a resource only but they convey the information about representation format and version.
#### Example 2
The rule
> HTTP message body MUST be used to transfer the message content
implies an HTTP GET request MUST NOT use HTTP message body to identify the resource. For example a request:
```
GET /greeting HTTP/1.1
Content-Type: application/json
...
{
"filter": "string"
"depth": 3
}
```
is **illegal**. To express identity use URI and query parameters instead e.g. `/greeting?filter=string&depth=3`.
---