414 URI Too Long

The URI or path of a HTTP request doesn’t have any hard limits in terms of how long it’s allowed to be.

However, Browsers and search engines have limits, and on the server side it’s a good idea to limit the length of the URI to combat certain denial-of-service attacks or bugs.

Based on limits of browsers, it’s a good idea to try and not exceed 2000 bytes for the uri.

When a client does exceed it, the appropriate status code to return is 414 URI Too Long.

Example

HTTP/1.1 414 URI Too Long
Content-Type: text/html

<p>Insufficient level of conciseness in request</p>

References

HTTP series

This article is part of an ongoing series about the HTTP protocol.

If you want to follow along as I write them, you can Subscribe to my Atom feed or Mailing list.

Informational 1xx

Successful 2xx

Redirection 3xx

Client Error 4xx

Web mentions