414

URI Too Long

Overview

414 URI Too Long means the request URI is longer than the server is willing to interpret. It is usually caused by stuffing too much data into a GET query string.

The spec sets no hard URL length limit, but servers, proxies, and browsers each impose one in practice (often around 8 KB). Passing hundreds of IDs or an encoded state blob as query parameters easily exceeds it.

When it happens

Request / Response example

Request
GET /search?q=aaaaaaaa...<8000+ chars>...zzzz HTTP/1.1
Host: example.com
Response
HTTP/1.1 414 URI Too Long
Content-Type: text/html
Content-Length: 40

<h1>414 Request-URI Too Long</h1>

In code

# Raise the buffers that hold the request line + URI
server {
  large_client_header_buffers 4 16k;
}
// Instead of a giant query string, POST the filter as JSON
await fetch('/search', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ ids: hugeArray })
});

Common causes

How to fix

Notes

Related status codes

Related headers

Specification