The Ultimate Guide to HTTP Status Codes (100–599)
A complete reference guide to all HTTP status codes from 100 to 599, with explanations and common use cases.
Feb 28, 2026
4xx Client Error
The 411 (Length Required) status code indicates that the server refuses to accept the request without a defined Content-Length header. The client must include a valid Content-Length header field containing the length of the message body.
When your API processes file uploads, require a Content-Length header to know the file size before reading the body. If the header is missing, return 411 Length Required. This allows the server to reject oversized files early without reading the entire payload.
// Laravel middleware - requiring Content-Length
if (! $request->headers->has('Content-Length') && $request->getContent()) {
return response()->json([
'error' => 'Content-Length header is required',
], 411);
}