0

Sending request with URL length ~ 4950 characters.

Getting the following XMLHTTPRequest.ResponseText:

ERROR
The requested URL could not be retrieved

While trying to retrieve the URL: ##my long url##
The following error was encountered:
Invalid URL
Some aspect of the requested URL is incorrect. Possible problems:
Missing or incorrect access protocol (should be `http://'' or similar)
Missing hostname
Illegal double-escape in the URL-Path
Illegal character in hostname; underscores are not allowed
Your cache administrator is webmaster. 

But when I'm entering the same url in the browser it works just fine. I checked for possible errors(that are listed in the response text) - everything's ok.

When the number of parameters is less than ~200 the script works, so the clue must be in some limits. On the other hand there are no any settings in the apache or php or js.

Any advices or where should I look(some additional configs or whatever) for the solution?

whn
  • 321
  • 3
  • 11

2 Answers2

2

Sending request with URL length ~ 4950 characters.

That is too much for Internet Explorer anyway. Also possibly for Opera, which IIRC has a limit of 4096 bytes for GET requests.

You should use POST for this amount of data.

Maximum URL length is 2,083 characters in Internet Explorer

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
0

Apache replies with 413 Entity Too Large if the URL exceeds approximately 4000 characters (request lines are capped to 8190 bytes).

Using the LimitRequestLine directive won't help, you'll have to recompile Apache with -D DEFAULT_LIMIT_REQUEST_LINE=some huge value if you absolutely want to send large GET requests.

EDIT: Some thoughts about the ~4000 character cap: 8190 looks a lot like 8192 with two bytes reserved for the string terminator, so there's a good chance that Apache uses UCS-2 or similar to store request lines, since DEFAULT_LIMIT_REQUEST_LINE is expressed in bytes, not characters.

That would give a 4095 character cap per request line, i.e. a maximum URL length of 4079 characters (taking into account the initial GET and the final CR/LF pair), which would make sense.

Community
  • 1
  • 1
Frédéric Hamidi
  • 258,201
  • 41
  • 486
  • 479