Start free · Free tools · Fair usage limits
Browse Tools

Categories

Custom AI Solutions – AI2Flows
LIVE NEWS
Loading latest AI & SEO news…
Home›Tools›HTTP Status Codes Reference›HTTP 411 Length Required
4xx Client Error

HTTP 411 Length Required

HTTP 411 Length Required means the server refuses the request because it has a body but no Content-Length header. Some servers and proxies will not accept…

Quick answer

HTTP 411 Length Required means the server refuses the request because it has a body but no Content-Length header. Some servers and proxies will not accept chunked request bodies, so the client must send the exact body length.

Last updated · Maintained by FreeAIToolz · How we test

What does HTTP 411 Length Required mean?

It usually appears with hand-written HTTP clients, streaming uploads or empty POST requests sent without Content-Length: 0.

Status code411
NameLength Required
Class4xx Client Error
Defined inRFC 9110 §15.5.12
Cacheable by defaultNo, unless Cache-Control says so
Safe to retry automatically?No: change the request first
Related headersContent-Length

What causes HTTP 411?

  • POST or PUT without Content-Length, including empty bodies.
  • Chunked transfer encoding sent to a server that does not accept it.

How do I fix HTTP 411?

  1. Send Content-Length (Content-Length: 0 for empty bodies).
  2. Buffer the body before sending if the server cannot accept chunked uploads.

What should a client do after HTTP 411?

Add Content-Length and retry.

Does HTTP 411 affect SEO?

No SEO impact.

Example 411 response

HTTP/1.1 411 Length Required
Date: Mon, 01 Dec 2026 12:00:00 GMT
Content-Type: application/json

{"error":{"status":411,"message":"Length Required"}}

How to return 411 Length Required in code

Express (Node.js)

res.status(411).json({ error: 'Length Required' });

Next.js route handler

return Response.json({ error: 'Length Required' }, { status: 411 });

FastAPI (Python)

raise HTTPException(status_code=411, detail="Length Required")

PHP

http_response_code(411);

Nginx

location = /example {
    return 411;
}

Other 4xx status codes

The request contains an error or cannot be fulfilled as sent. Fix the request before retrying.

Frequently asked questions

Why does an empty POST return 411?
Some servers require Content-Length even when the body is empty. Send Content-Length: 0.
Can I use chunked uploads instead?
Only if the server supports chunked request bodies. A 411 means this one does not.
Is 411 a client or server error?
411 is in the 4xx class, so it is classed as a client error: the request needs to change before it can succeed.