HTTP协议使用哪种编码?

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

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

发布评论

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

>www.elefans.com

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