Client Error · 4xx

411 Length Required

The request lacks a Content-Length header that the server requires.

What 411 Length Required means

411 Length Required is rare in modern HTTP. The server is rejecting a request because it has a body but no Content-Length header (and the server does not support chunked transfer encoding for this endpoint). Most modern HTTP clients set Content-Length automatically, so 411 mostly shows up when handcrafting requests or using ancient libraries.

When servers should return it: Return 411 when your server cannot handle requests without a Content-Length and the client did not send one.

Common causes

How to fix 411 Length Required

Example response

HTTP/2 411
content-type: text/plain
Content-Length header required

Related status codes

Frequently Asked Questions

Why is 411 rare?
Modern HTTP clients (curl, fetch, requests, etc.) set Content-Length automatically. You only see 411 with handcrafted requests or unusual streaming clients.
Defined in: RFC 9110 · Class: 4xx Client Error

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.