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

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Content-Length
CORS-safelisted response header

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

参见