> For the complete documentation index, see [llms.txt](https://valineliu.gitbook.io/deuterium-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://valineliu.gitbook.io/deuterium-wiki/reading/cs-jing-dian-shu-ji/http/ch17-content-negotiation-and-transcoding.md).

# ch17: Content Negotiation and Transcoding

![17.内容协商和转码](https://tva1.sinaimg.cn/large/007S8ZIlly1ggq9rjv7bvj30yq0u0tcz.jpg)

## 1. Content-Negotiation Techniques

* Client-driven
* Server-driven
* Transparent

## 2. Client-Driven Negotiation

The easiest thing for a server to do when it receives a client request is to send back a response listing the available pages and let the client decide which one it wants to see.

Increased latency and annoyance of multiple requests per page.

Requires multiple URLs.

## 3. Server-Driven Negotiation

Content-Negotiation Headers:

| Header          | Description                                               |
| --------------- | --------------------------------------------------------- |
| Accept          | Used to tell the server what media types are okay to send |
| Accept-Language | Used to tell the server that languages are okay to send   |
| Accept-Charset  | Used to tell the server what charsets are okay to send    |
| Accept-Encoding | Used to tell the server what encodings are okay to send   |
