414 URI Too Long
The request target is longer than the server is willing to interpret.
Status
HTTP/1.1 414 URI Too Long
Details
- Category: 4xx
- Status: Standard. Registered with IANA and defined by a current standards-track RFC.
- Specification: RFC 9110 §15.5.15
- Cacheable: Cacheable by default
- Response body: Allowed
- Retry: Retry only after changing the request
There is no limit on URL length in the HTTP specification, but every implementation picks one. Browsers, proxies, and servers all differ, with common server limits around 8KB for the whole request line and header block.
The usual cause is a GET where a POST belongs: filters, search state, or a serialized object pushed into the query string until it overflows. It can also result from a redirect loop that appends parameters on every hop.
Common causes
- A query string carrying serialized state, long filter lists, or an encoded token.
- A redirect loop that appends a parameter each time around.
- A GET used where the API expects a POST with a body.
How to fix it
As the client
- Move the data into a request body with POST.
- Shorten the query: send identifiers rather than whole objects.
- Check for a redirect loop if the URL grows on every request.
As the server
- Provide a POST-based search endpoint for complex queries.
- Raise the header buffer size if long URLs are legitimate, for example large_client_header_buffers in nginx.
Examples
GET /search?filters=%7B%22a%22%3A1%7D...(9KB of query string) HTTP/1.1 Host: www.example.com HTTP/1.1 414 URI Too Long