-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Content Negotiation | ||
=================== | ||
|
||
`Content negotiation`_ is a mechanism defined in the `HTTP specification`_ that makes it possible to serve different versions of a document (or more generally, a resource representation) at the same URI, so that user agents can specify which version fit their capabilities the best. | ||
|
||
The user agent (or the REST consumer) can ask for a specific representation by providing an Accept HTTP header that lists acceptable media types (e.g. JSON):: | ||
|
||
GET / | ||
Accept: application/json | ||
|
||
The server is then able to supply the version of the resource that best fits the user agent's needs. This is reflected in the Content-Type header:: | ||
|
||
HTTP 200 OK | ||
Content-Type: application/json | ||
|
||
{ | ||
'data': ... | ||
} | ||
|
||
.. _`Content negotiation`: http://tools.ietf.org/html/rfc7231#section-5.3 | ||
|
||
.. _`HTTP specification`: http://tools.ietf.org/html/rfc7231 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ Contents | |
:maxdepth: 3 | ||
|
||
introduction | ||
content-negotiation | ||
|
||
.. hydra | ||
.. item | ||
|