Solved

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

Posted on 2001-08-02
6
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
asp Google Map 2 91
Obsolete font tag need to convert to CSS 3 54
warning code: class php incomplete message 6 69
ReadyAPI 1.9.0 2 42
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to dynamically set the form action using jQuery.

732 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