subscribe

416 Range Not Satisfiable

It’s possible for a client to request partial responses from a server. For example, a client might only want the first 5 minutes of a video, or the last 100 lines of a log file.

HTTP clients and servers can do this with range requests.

For example, this request asks for the first 100 bytes:

GET /foo.md HTTP/1.1
Range: bytes=1-100

If a server doesn’t support range requests, it will return 200 OK and returns the entire resource. If it did support range requests, it can use 206 Partial Content and return just what the client asked for.

However, if a client requested a range that didn’t make sense, it can use 416 Range Not Satisfiable to indicate this. For example, maybe a file was 1024 bytes, and the client asked for bytes 2000-3000.

HTTP/1.1 416 Range Not Satisfiable
Content-Range: bytes */1000

References

HTTP series

This article is part of a series about the HTTP protocol. Read them all here:

Informational 1xx

Successful 2xx

Redirection 3xx

Client Error 4xx

Server Error 5xx

Web mentions