22Content Negotiation
33###################
44
5- Content negotiation is a way to determine what type of content to return to the client based on what the client
6- can handle, and what the server can handle. This can be used to determine whether the client is wanting HTML or JSON
7- returned, whether the image should be returned as a jpg or png, what type of compression is supported and more. This
8- is done by analyzing four different headers which can each support multiple value options, each with their own priority.
9- Trying to match this up manually can be pretty challenging. CodeIgniter provides the ``Negotiator `` class that
10- can handle this for you.
11-
125.. contents ::
136 :local:
147 :depth: 2
@@ -17,6 +10,14 @@ can handle this for you.
1710What is Content Negotiation?
1811****************************
1912
13+ Content negotiation is a way to determine what type of content to return to the client based on what the client
14+ can handle, and what the server can handle. This can be used to determine whether the client is wanting HTML or JSON
15+ returned, whether the image should be returned as a JPEG or PNG, what type of compression is supported and more. This
16+ is done by analyzing four different headers which can each support multiple value options, each with their own priority.
17+
18+ Trying to match this up manually can be pretty challenging. CodeIgniter provides the ``Negotiator `` class that
19+ can handle this for you.
20+
2021At it's heart Content Negotiation is simply a part of the HTTP specification that allows a single
2122resource to serve more than one type of content, allowing the clients to request the type of
2223data that works best for them.
0 commit comments