当浏览器向 Web 服务器发送 HTTP 请求时,使用什么编码来对网络上的 HTTP 协议进行编码?是ASCII吗?UTF8?还是UTF16?或者它是否指定了它以预定义格式使用的编码(在任何解码发生之前?)
When a browser sends an HTTP request to a web server, what encoding is used to encode the HTTP protocol on the wire? Is it ASCII? UTF8? or UTF16? Or does it specify which encoding it uses in a predefined format (before any decoding takes place?)
附言我不是在询问请求/响应的实际有效负载(例如 HTML).我在询问请求行(即 GET/index.html HTTP/1.1)和标头(即 Host: google)
P.S I'm not asking about the actual payload (e.g. HTML) of the request/response. I'm asking about the request line (i.e. GET /index.html HTTP/1.1) and headers (i.e. Host: google)
推荐答案HTTP 1.1 使用 US-ASCII 作为 请求行 在请求中,状态行 在响应中(除了 原因短语) 和 字段名称 但允许字段值和 消息正文.
HTTP 1.1 uses US-ASCII as basic character set for the request line in requests, the status line in responses (except the reason phrase) and the field names but allows any octet in the field values and the message body.
更多推荐
HTTP 协议使用哪种编码?
发布评论