Range
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.
The Range
是一个请求首部,告知服务器返回文件的哪一部分。在一个 Range
首部中,可以一次性请求多个部分,服务器会以 multipart 文件的形式将其返回。如果服务器返回的是范围响应,需要使用 206
Partial Content
状态码。假如所请求的范围不合法,那么服务器会返回 416
Range Not Satisfiable
状态码,表示客户端错误。服务器允许忽略 Range
首部,从而返回整个文件,状态码用 200
。
Header type | Request header |
---|---|
Forbidden header name | no |
语法
Range:= - Range: = - Range: = - , - Range: = - , - , -
指令
示例
Range: bytes=200-1000, 2000-6576, 19000-
规范
Specification |
---|
HTTP Semantics # field.range |
浏览器兼容性
参见
If-Range
Content-Range
Content-Type
206
Partial Content
416
Range Not Satisfiable