Solved

Is there a restriction on the size of a URL/Query string?

Posted on 2001-08-02
6
222 Views
Last Modified: 2013-12-25
Hi,

I have come across web servers that truncate the query parameters present in the url (e.g. http://mypage.com/myPage.jsp?arg1=23&arg2=45) if the whole string exceeds a size limit?

Is there any such limit in HTTP protocol, if yes what is the limit and where is it defined?  Has anybody experienced such stuff?  Is it a browser problem, if yes, do IE and NN both do that?

I would really appreciate a quick response.

Thanks,

KM
0
Comment
Question by:kmahmood
6 Comments
 
LVL 18

Expert Comment

by:mgfranz
ID: 6350500
It depends on how the data is passed to the page, if the <form> field uses POST, then the limit is 254 characters.  GET allows something like 64k.

I do not recommend passing anything more that 254 characters in the URL string, more than that can cause a bind on the server.  If you have to, use Sessions, Cookies, or hidden field parameters instead.

IE is a little more forgiving than NN, (not sure about NN6 though).
0
 
LVL 1

Accepted Solution

by:
gordonmcmullan earned 20 total points
ID: 6400215
Hi,

I think you have this the wrong way round.

GET requests should be kept below 255 characters.

A GET request is encoded into the URL submitted to a server whilst a POST request is contained in the data section of the request.

There are some browsers, proxies, caches, etc out there that truncate URL's over 255 characters, thus affecting the GET request. If you are expecting to exceed 255 characters in your data then use POST when submitting your request. (note: URL encoding for characters not allowed in URLs may increase the size of the URL you need)

This does have a downside as the request is no longer bookmarkable.

255 characters gives a fairly long string is this the limit you are seeing?

Gordon McMullan
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 6400458
DOH, your right... Thanks Gordon.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 5

Expert Comment

by:raizon
ID: 6450793
The HTTP protocol itself doesn't restrict the limit the size of the query string.  Its the browsers that do.  IE limits it to essentially 3k, where with Netscape I havn't been able to find any information on what the limit is.
0
 
LVL 18

Expert Comment

by:bruno
ID: 6840817
Hello,

This question has been open for quite a while now and needs to be wrapped up.

Please do NOT accept this comment as an answer, as I am simply trying to alert those involved that the
question is still open.

If any of the experts could come back and post any suggestions as to how they feel this could be wrapped
up (delete, 0 PAQ, award points, etc), I'm sure the moderators would appreciate it.

Thank you,

BRUNO
0
 
LVL 5

Expert Comment

by:raizon
ID: 6841578
I vote for a delete.  There really isn't any information worth  a 0 PAQ.  Either that or split the points between gordon and mgfranz
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now