411 HTTP Origin: Network OSI layer 7 · Application Last updated 12 Oct 2026

HTTP 411 Length Required

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

Exact message you may see length requiredContent-Length required
Seen on: Linux REST API

Meaning

Some servers and proxies won’t accept chunked transfer encoding for uploads and require the body size up front. It often shows up with empty POST requests or streaming uploads.

Common causes

  • POST/PUT with no body and no Content-Length: 0
  • Chunked uploads to a server/proxy that doesn’t support them
  • HTTP client library streaming a body of unknown length

⚡ Quick fix

  1. Send Content-Length: 0 for empty POSTs (curl: -d '')
  2. Buffer the body so the client can compute its length
  3. Upload to storage with a pre-signed URL that supports chunking

Detailed fix by platform

Linux

  1. curl:
    bash
    curl -X POST https://api.example.com/jobs/42/start -H 'Content-Length: 0'
    # or
    curl -X POST https://api.example.com/jobs/42/start -d ''

How to diagnose

  1. Headers — Is Content-Length or Transfer-Encoding: chunked sent?
  2. Body — Empty or streamed?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

100 — HTTP 100 Continue (HTTP)100103 — HTTP 103 Early Hints (HTTP)1031040 — Cloudflare Error 1040 / 1041: Invalid request header modification (Cloudflare)1040400 — HTTP 400 Bad Request (HTTP)400400 — 400 Bad Request: Request Header Or Cookie Too Large (HTTP)400400 — 400 Bad Request: invalid character in header (HTTP)400401 — 401 Unauthorized without WWW-Authenticate header (HTTP)401413 — HTTP 413 Content Too Large (Request Entity Too Large) (HTTP)413411

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.