How to Fix 411 Length Required Error
What 411 Length Required means
When your browser or an app sends data to a website, for example when you submit a form, upload a file, or call an API, the request usually carries a body: the actual data being sent. The Content-Length header is a simple number in that request that tells the server exactly how many bytes of body data to expect. HTTP status 411, Length Required, means the server refused the request because that header was missing. The server is not saying your data was too large or that the page does not exist. It is saying it will not process a body whose size it was not told in advance, because without that number it cannot tell where the body ends and the next request begins.
You will usually meet a 411 on form submissions, file uploads, and API calls rather than on ordinary page loads, because a plain page visit with a GET request normally has no body at all. The error can come from your side, for instance an outdated app or an extension that mangles headers, or from the site side, for instance a hand-built API client that never sets Content-Length, or a proxy that strips the header in transit. A related but different error is 413, which means the body was too large; with a 411, the problem is a missing length, not an oversized one. Knowing that distinction tells you where to look: at the headers of the failed request, not at your connection or at the size of the file.
Common causes
- Missing Content-Length header: the client sent a POST, PUT, or PATCH request with a body but never included a Content-Length header, often because the request was built by hand or streamed without buffering.
- Chunked transfer encoding: the body was sent in chunks with no total size up front, and the server, proxy, or load balancer in the chain does not accept chunked requests and answers with 411.
- Proxy, CDN, or gateway stripping headers: a proxy, content delivery network, or API gateway between you and the server removed or rewrote the Content-Length header before the request reached the origin server.
- Outdated browser, app, or extension: an old client or an aggressive privacy, ad-blocking, or VPN extension altered the request headers so the length header never arrived intact.
- Server or security rule demanding a length: a server configuration or security module that requires a Content-Length header on every body request, even for endpoints that could legitimately accept chunked uploads.
How to fix the 411 Length Required error — step by step
Start with the visitor steps (1–3). If you control the code or the site, steps 4–6 are where most persistent 411 errors get fixed.
- Retry the request and refresh the page properly. A one-off 411 can come from a request that was interrupted or sent without its headers, so start simple: reload the page, then resubmit the form or retry the upload once. If the browser asks whether to resend the form data, confirm it. If the error clears on the second try, the first request was simply malformed or cut short, and nothing on your device needs changing.
- Clear cache and cookies, then test in an incognito window. A stale cached page or a corrupted cookie can make a browser or app send a broken request. Press Ctrl + Shift + Delete, set the range to All time, check Cached images and files and Cookies and other site data, and click Clear data. Then open an incognito window (Ctrl + Shift + N) and try the same action again. If it works in incognito, a cached file, a cookie, or an extension in your normal window is interfering with the request.
- Update the browser or app and disable interfering extensions. Old browsers, outdated apps, and aggressive extensions can strip or mangle request headers. Update your browser or app to the latest version, then temporarily disable ad blockers, privacy extensions, and VPN or proxy extensions and test again. If the request succeeds with extensions off, re-enable them one at a time to find the one that breaks it, then leave that one off for this site or add the site to its allow list.
- Developer: send a correct Content-Length header with the body. If you control the client or the code making the request, make sure every POST, PUT, or PATCH request that carries a body includes a Content-Length header whose value equals the exact byte size of that body, not the character count. Most HTTP libraries set this automatically, but hand-built requests, raw socket code, and some streaming uploads do not. Do not send both Content-Length and Transfer-Encoding: chunked in the same request, and do not send a Content-Length of zero with a body attached. After fixing the header, resend the request and confirm the server returns 200 or another success status instead of 411.
- Fix chunked uploads, proxies, and load balancers in the middle. Chunked transfer encoding sends a body without a known length up front, and some servers, proxies, and older load balancers reject such requests with a 411. If your upload uses chunked encoding, switch to a buffered request with a known Content-Length where the body size is known. Check any proxy, CDN, or API gateway between the client and the server: it should forward the Content-Length header unchanged rather than stripping it or converting the request to chunked encoding. Test the same request directly against the origin server to see whether the middle layer is the problem.
- Site owner: check server settings, then test with curl. If you own the site, confirm your server is not demanding a Content-Length header where it should accept chunked requests, and check for a reverse proxy or security module that drops headers. In Apache and Nginx, review the proxy and request-handling settings for the affected location and remove any rule that strips Content-Length. From a terminal, test with curl -i -X POST --data-binary followed by your data and the URL: curl sets Content-Length automatically, so a success there while your app still fails points at the app, not the server. Check the server error log for the matching 411 entries, which show the exact request that was refused.
Did this fix it? Quick checklist
- The form, upload, or API call completes without a 411 message
- The request includes a Content-Length header matching the body size
- It works in an incognito window and after clearing cache
- No proxy, CDN, or server rule still strips the length header
If the error only appears on one network, such as office or school Wi-Fi, a proxy on that network may be rewriting your requests — try your phone's mobile data to confirm. On the owner side, if the 411 started right after adding a proxy, a CDN rule, or a new API client, that change is the prime suspect: roll it back temporarily and test before rewriting application code.
Frequently asked questions
What does a 411 Length Required error mean?
It means the server refused your request because it did not include a Content-Length header. The Content-Length header tells the server how many bytes of data are coming in the request body. Without it, the server cannot tell where the body ends, so it rejects the request instead of guessing.
Is a 411 error caused by my internet connection?
Usually not. A 411 is about the request itself, not your connection speed or signal. It happens when a browser, app, form, or API call sends a request body without a Content-Length header, or when a proxy or extension strips that header on the way. A broken connection can interrupt a request, but the 411 itself points at a missing header.
What is the difference between a 411 and a 413 error?
A 411 means the request was missing its Content-Length header entirely, so the server refused to process it. A 413 means the request did include a length, but the body was larger than the server is willing to accept. Fixing a 411 means supplying a correct length header; fixing a 413 means sending a smaller body or raising the server size limit.
How do website owners fix a persistent 411 error?
Make sure the client sends a correct Content-Length header, avoid mixing Content-Length with chunked transfer encoding, and check that no proxy, CDN, or security module strips the header in transit. Review the server error log for the exact refused requests, test with curl to isolate the client from the server, and update any server rule that rejects requests without a length header when chunked uploads should be allowed.