13 May 2008

The Maximum Legal Length Of A Url

While the HTTP specification does not specify any maximum length, practical limits do exist.

For example, Google servers allow only 2038 characters as the query length, throwing a HTTP 400 “Bad Request”. This limit would normally not bother surfers, but if you are using a URL based API, like the Google Chart API, this limit gets to you sooner than you would like.

Note that Google is well aware of this, which is why they have a weird “Simple Encoding” to circumvent this limit to an extent.