0

I have an application that accesses a script on my server. I pass quite a long query string with my url. The length will change every so often but is always rather long.

Is there a limit to the length of the url or query string? Should I be sending the query string parameters in post - will that give me more length?

Important information:

  • The server is Linux
  • The application code is Python and uses urllib2 to access the script
  • The script on the server is a Python script

Code used to access script:

urllib2.urlopen( "www.site.com?verylongquerystring" )
sazr
  • 24,984
  • 66
  • 194
  • 362
  • 1
    See this question: [What is the maximum possible length of a query string?](http://stackoverflow.com/questions/812925/what-is-the-maximum-possible-length-of-a-query-string) – Jeff Sep 18 '14 at 00:38
  • [Maximum URL length is 2,083 characters in Internet Explorer](http://support.microsoft.com/kb/208427) – kums Sep 18 '14 at 01:50
  • 1
    I would suggest using a `POST` HTTP request (not a `GET`) when you need a very long query; I hate URL larger than e.g. 80 or 100 characters. – Basile Starynkevitch Sep 18 '14 at 04:44

1 Answers1

0

HTTP 1.1 is defined in RFC 7231: https://www.rfc-editor.org/rfc/rfc7231

I find no mention of an upper limit on the length of a URL, or a query string, in RFC 7231.

A URL is defined in RFC 3986: https://www.rfc-editor.org/rfc/rfc3986

I find no mention of an upper limit there, either.

It's possible that a particular implementation, like your python library, might impose some limitation, but I think that's unlikely.

It's a pretty safe bet to say that there is no upper limit to the length of a URL, or a query string.

Community
  • 1
  • 1
Sam Varshavchik
  • 114,536
  • 5
  • 94
  • 148