[Bioperl-l] NCBI GenBank web retrieval

dalke@xebte.pair.com dalke@xebte.pair.com
19 Jan 2002 23:15:56 -0000


Jason:
> Are there limits to size of URLs ?

RFC 2068 says:
     Note: Servers should be cautious about depending on URI lengths
     above 255 bytes, because some older client or proxy implementations
     may not properly support these lengths.

The CGI protocol uses environment variables.  There is limited space
for environment variables, at least under Unix, so even if the above
caution isn't true you can only send about 100K of data.

>>> import os
>>> os.environ["LONG"] = "XXX"
>>> print os.popen("printenv LONG").read()
XXX

>>> len(os.popen("printenv LONG").read())
4
>>> for i in (1, 10, 100, 1000, 10000, 100000, 200000, 300000, 400000):
...     print i
...     os.environ["LONG"] = "X" * i
...     assert len(os.popen("printenv LONG").read())-1 == i, "less than %d"%i
...
1
10
100
1000
10000
100000
200000
Traceback (most recent call last):
  File "<stdin>", line 4, in ?
AssertionError: less than 200000
>>>

I first tested this about 4 years ago, and I recall that IRIX had about 15K
of space available, at least under IRIX 5.3.  I wouldn't depend on being
above to send anything long via GET.

					Andrew