MockFoxAdvertise

HTTP 411 Length Required

Updated Free mock REST & WebSocket APIs

HTTP 411 Length Required — The server refuses a request with a body but no Content-Length header.

Class
4xx Client Error
Defined in
RFC 9110 §15.5.12
Official
Yes (IANA registry)
Cacheable by default
No (unless Cache-Control/Expires say so)
Safe to retry
Not without changing the request

Try it: get a real 411 response

Our test endpoint answers every request with 411 Length Required.

curl -i https://mockfox.dev/api/status/411

Use it in tests, health-check monitors or to see how your client handles a 411. Add ?delay=2000 to slow it down.

What does HTTP 411 mean?

Some servers (and older proxies) require a Content-Length and won't accept chunked transfer encoding. Fix it by sending the length — most HTTP clients do this automatically when the body is a string or buffer rather than a stream. Also seen when a POST is sent with no body and no Content-Length: 0.

How to fix 411

  1. Visitors: Reload the page, check the address for typos, and clear the site's cookies. If it persists, the site owner needs to fix it.
  2. Developers: Read the response body and server logs for details, fix the request (method, headers, body, credentials) and return a clear error message to clients.

Example 411 response

HTTP/1.1 411 Length Required
Content-Type: application/json

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

4xx Client Error: The request contains an error or can't be fulfilled — fix the request before retrying. See the full list of HTTP status codes.

Related status codes

Related tools

Frequently asked questions

What does HTTP 411 Length Required mean?

The server refuses a request with a body but no Content-Length header.

Is 411 a client or a server error?

411 is a 4xx code, so it signals a problem with the request (as seen by the server). Retrying the identical request usually gives the same result.

Where is 411 defined?

In RFC 9110 §15.5.12. It's listed in the IANA HTTP Status Code Registry.

How can I test how my app handles a 411?

Call https://mockfox.dev/api/status/411 — it responds with 411 to any method, with CORS enabled. Add ?delay=2000 to simulate a slow response.