当浏览器向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?)
PS 我不是在问实际有效载荷(例如HTML)请求/响应。我问的是请求行(即 GET /index.html HTTP / 1.1 )和标题(即主持人: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协议使用哪种编码?
发布评论