Does anyone know what the maximum length that a query string can be in a URL? (Please note that by query string I mean the bit after the ? int he URL) I know that the maximum length of a domain name is 255 characters, and I wondered if it would be the same.

    I wondered about this once and had a bit of a dig around the W3C. I got the impression that there is no explicit limit (RFC2396, for example, is silent on the matter). In fact, the only mention I found regarding the matter - and what it provides is a lower bound - is in RFC2616:

    3.2.1 General Syntax

    URIs in HTTP can be represented in absolute form or relative to some known base URI [11], depending upon the context of their use. The two forms are differentiated by the fact that absolute URIs always begin with a scheme name followed by a colon. For definitive information on URL syntax and semantics, see "Uniform Resource Identifiers (URI): Generic Syntax and Semantics," RFC 2396 (which replaces RFCs 1738 and RFC 1808). This specification adopts the definitions of "URI-reference", "absoluteURI", "relativeURI", "port", "host","abs_path", "rel_path", and "authority" from that specification.

    The HTTP protocol does not place any a priori limit on the length of a URI. Servers MUST be able to handle the URI of any resource they serve, and SHOULD be able to handle URIs of unbounded length if they provide GET-based forms that could generate such URIs. A server SHOULD return 414 (Request-URI Too Long) status if a URI is longer than the server can handle (see section 10.4.15).

    Note: Servers ought to be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations might not properly support these lengths.

    So the practical upshot would presumably be that clients should be able to cope with URIs that are 255 bytes long, while servers should be able to cope with whatever they can dish out.

      And by 255 bytes, am I right in assuming that means 255 characters.

      Although it says they should be able to cope with 255 bytes, there is nothing that says that the string can be moer than that, is there? I have searched on google and not really found anything to say otherwise...

        Sounds like a little experimentation is in order 🙂

          Originally posted by BuzzLY
          Sounds like a little experimentation is in order 🙂

          cool, do we get to play with fire and chemicals and stuff, huh, huh, do we 😃

            Ok, who's been letting him have sugar again?

              Originally posted by piersk
              Ok, who's been letting him have sugar again?

              WeedPacket's been feeding me Butterscotch Schnapps!

                Originally posted by stolzyboy
                WeedPacket's been feeding me Butterscotch Schnapps!

                Look, stop trying to talk; you're making me spill it everywhere.

                  Don't waste it.

                  <pirate-style accent>There's good booze in that thar bottle</tnecca elyts-etarip>

                    Write a Reply...