414 URI Too Long

HTTP response status code 414 URI Too Long is a client error that is returned by the server to indicate that the URI exceeds the length that it allows.

Usage

When the 414 URI Too Long error message is received, the client understands that the server expects a smaller HTTP path or address. While the specification does not stipulate any requirement for length, in practice, browsers may limit the size to prevent certain types of attacks.

For example, many web applications limits the size of the URL for an HTTP GET request to 2,048 characters. This, however, may not be a limit enforced by the server or browser.

Note

Search engines like Google will not index a URL with 414 URI Too Long response status, and consequently, URLs that have been indexed in the past but are now returning this HTTP status code will be removed from the search results.

Example

In the example, the client requests a resource using a URI that is beyond what the server allows.

Request

GET /<…a_long_URI…> HTTP/1.1
Host: www.example.re

Response

HTTP/1.1 414 URI Too Long

Code references

.NET

HttpStatusCode.RequestUriTooLong

Rust

http::StatusCode::URI_TOO_LONG

Rails

:request_uri_too_long

Go

http.StatusRequestURITooLong

Symfony

Response::HTTP_REQUEST_URI_TOO_LONG

Python3.5+

http.HTTPStatus.REQUEST_URI_TOO_LONG

Java

java.net.HttpURLConnection.HTTP_REQ_TOO_LONG

Apache HttpComponents Core

org.apache.hc.core5.http.HttpStatus.SC_REQUEST_URI_TOO_LONG

Angular

@angular/common/http/HttpStatusCode.UriTooLong

Takeaway

The 414 URI Too Long status code is a client error that occurs when the URI is larger than the server is willing to accept.

See also

Last updated: August 2, 2023