HTTP协议使用哪种编码? [英] Which encoding is used by the HTTP protocol?

查看:194
本文介绍了HTTP协议使用哪种编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当浏览器向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.com

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.com)

推荐答案

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协议使用哪种编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆