HTTP 协议使用哪种编码?

编程入门 行业动态 更新时间:2024-10-22 16:22:10
本文介绍了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?)

附言我不是在询问请求/响应的实际有效负载(例如 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 协议使用哪种编码?

本文发布于:2023-11-26 13:06:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1633983.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:哪种   协议   HTTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!