Content-Length

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

HTTP Content-Length 标头表示发送给接收方的消息体的大小(以字节为单位)。

标头类型 请求标头响应标头内容标头
禁止修改的标头
列入 CORS 白名单的响应标头

语法

http
Content-Length: <length>

指令

<length>

以字节为单位的长度。

规范

Specification
HTTP Semantics
# field.content-length

浏览器兼容性

BCD tables only load in the browser

参见