# 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   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://valineliu.gitbook.io/deuterium-wiki/reading/cs-jing-dian-shu-ji/http/ch17-content-negotiation-and-transcoding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
