414 URI Too Long
The URL is longer than the server is willing to process, often because too much data was packed into the query string.
What 414 URI Too Long means
Older specs called this Request-URI Too Long. Servers set a maximum URL length, and anything over it gets 414.
It usually points to data that belongs in a request body, or to a bug that keeps adding to the URL.
Common causes
- Large data in query parameters, such as long lists of IDs or encoded JSON.
- A form using GET for a large amount of input.
- A redirect loop that appends the query string again on every hop.
How to fix 414 URI Too Long
- Move the data into the request body and use POST.
- Look for redirect rules that repeat the query string.
- If long URLs are expected, raise the server limit (large_client_header_buffers in nginx).
Example response
HTTP/1.1 414 URI Too Long
Content-Type: text/plain; charset=utf-8
414 URI Too LongHow to check for a 414 response
cURL
# Print only the status code
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/JavaScript (Node.js)
const res = await fetch("https://example.com/");
if (res.status === 414) {
console.log(res.status, res.statusText);
}Python
import requests
res = requests.get("https://example.com/")
if res.status_code == 414:
print(res.status_code, res.reason)Go
res, err := http.Get("https://example.com/")
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode == 414 {
fmt.Println(res.Status)
}Specification
414 URI Too Long is defined in RFC 9110, section 15.5.15.
Related status codes
- 413
The request body is bigger than the server is willing to accept, usually because an upload is over the size limit.
- 431
Request Header Fields Too Large
The server refuses the request because its headers are too big, usually because of too many or oversized cookies.
- 400
The server could not understand the request because something in it is malformed, like broken JSON, bad syntax or invalid headers.