Skip to content

Commit 23087c6

Browse files
committed
docs: move "What is Content Negotiation?" to content_negotiation.rst
1 parent 968f03f commit 23087c6

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

user_guide_src/source/incoming/content_negotiation.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,26 @@ can handle this for you.
1313
:local:
1414
:depth: 2
1515

16+
****************************
17+
What is Content Negotiation?
18+
****************************
19+
20+
At it's heart Content Negotiation is simply a part of the HTTP specification that allows a single
21+
resource to serve more than one type of content, allowing the clients to request the type of
22+
data that works best for them.
23+
24+
A classic example of this is a browser that cannot display PNG files can request only GIF or
25+
JPEG images. When the server receives the request, it looks at the available file types the client
26+
is requesting and selects the best match from the image formats that it supports, in this case
27+
likely choosing a JPEG image to return.
28+
29+
This same negotiation can happen with four types of data:
30+
31+
* **Media/Document Type** - this could be image format, or HTML vs. XML or JSON.
32+
* **Character Set** - The character set the returned document should be set in. Typically is UTF-8.
33+
* **Document Encoding** - Typically the type of compression used on the results.
34+
* **Document Language** - For sites that support multiple languages, this helps determine which to return.
35+
1636
*****************
1737
Loading the Class
1838
*****************

user_guide_src/source/incoming/message.rst

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,6 @@ This class is the parent class that both the :doc:`Request Class </incoming/requ
1111
negotiation methods, may apply only to a request or response, and not the other one, but they have
1212
been included here to keep the header methods together.
1313

14-
What is Content Negotiation?
15-
============================
16-
17-
At it's heart Content Negotiation is simply a part of the HTTP specification that allows a single
18-
resource to serve more than one type of content, allowing the clients to request the type of
19-
data that works best for them.
20-
21-
A classic example of this is a browser that cannot display PNG files can request only GIF or
22-
JPEG images. When the server receives the request, it looks at the available file types the client
23-
is requesting and selects the best match from the image formats that it supports, in this case
24-
likely choosing a JPEG image to return.
25-
26-
This same negotiation can happen with four types of data:
27-
28-
* **Media/Document Type** - this could be image format, or HTML vs. XML or JSON.
29-
* **Character Set** - The character set the returned document should be set in. Typically is UTF-8.
30-
* **Document Encoding** - Typically the type of compression used on the results.
31-
* **Document Language** - For sites that support multiple languages, this helps determine which to return.
32-
3314
***************
3415
Class Reference
3516
***************

0 commit comments

Comments
 (0)