这是什么意思?

头中指定编码的已编码内容字符串的字节数。 内容字符串的字符数。

特别是在Content-Type: application/x-www-form-urlencoded的情况下。


当前回答

一个八位是8位。Content-length是消息体所代表的字节数。

其他回答

从本页

The most common use of POST, by far, is to submit HTML form data to CGI scripts. In this case, the Content-Type: header is usually application/x-www-form-urlencoded, and the Content-Length: header gives the length of the URL-encoded form data (here's a note on URL-encoding). The CGI script receives the message body through STDIN, and decodes it. Here's a typical form submission, using POST: POST /path/script.cgi HTTP/1.0 From: frog@jmarshall.com User-Agent: HTTPTool/1.0 Content-Type: application/x-www-form-urlencoded Content-Length: 32

它是请求或响应体中数据的字节数。主体是出现在标题下面空行之后的部分。

一个八位是8位。Content-length是消息体所代表的字节数。

rfc2616

的Content-Length实体报头字段表示 entity-body,十进制形式的OCTETs,发送给接收方 HEAD方法的情况,entity-body的大小 如果请求是GET,则已经发送了。

内容类型是什么并不重要。

延长线在以下职位。

考虑一下你是否有这样的标题:

content-encoding: gzip
content-length: 52098
content-type: text/javascript; charset=UTF-8

内容长度是压缩消息体的大小,以“八位”为单位(即以8位为单位,这恰好是所有现代计算机的“字节”)。

实际消息体的大小可以是其他大小,可能是150280字节。

字符的数量也可以不同,可能是150231个字符,因为一些unicode字符使用多个字节(注意UTF-8是一种标准编码)。

所以,不同的数字取决于你是否关心有多少数据被传输,或者有多少数据被保存,或者有多少符号被看到。当然,不能保证会提供这些头文件。