in reply to 414 Request-URI Too Large

There are a couple of conditions that can cause this issue. One is a redirect URL prefix pointing to a suffix of itself. If you're doing any redirection, check for this.

The other rare, but still more common, instance occurs when generating a get request which has too many characters for a geniune URL (typically 2048 to 4096 bytes). This means switching back to a post from a get. I see that you state that you are using a post method, so I would examine the raw HTTP headers to verify that your client isn't erroneously sending the request via the get method. Stranger things have been known to happen.

Also, I don't know how to find this in Apache, but if you could find out the max length of requests and how to set this, it may help. CGI.pm can also throw an error if you exceed maximum post length, but I believe that it's just a simple die message and doesn't generate a 414. Probably generates a 5xx status code on the die.

Cheers,
Ovid

Replies are listed 'Best First'.
RE: (Ovid) Re: 414 Request-URI Too Large
by merlyn (Sage) on Aug 31, 2000 at 19:16 UTC
    414 means "URI is too large". Under Apache, this is a configurable limit, controlled by the LimitRequestLine configuration parameter. The maximum for this parameter appears to be 8190 by default, but even that can be hacked at compile time.

    The W3 specs do not provide a "minimum maximum" or a "maxiumum maximum" for the length of a URI, so you really are on your own to see what will work in any given situation. There's no theoretical reason why a 50 megabyte GET would be disallowed, so the common chatter of "you can't have a URI longer than mumbleK bytes" has no basis in reality, because the right answer is "well, it depends".

    -- Randal L. Schwartz, Perl hacker

      I met it with CGI::Ajax. It makes my form buggy. (Ajax outputs are in a random case). Meanwhile, my requests have all a small length and are post-ed ! it appends at the nth entry. i have to catch the error ...
RE: (Ovid) Re: 414 Request-URI Too Large
by spudzeppelin (Pilgrim) on Aug 31, 2000 at 19:29 UTC

    I've seen oddball behavior with POST once before: a client, who I won't mention, had a not-so-great firewall configured and managed by another vendor. The client was trying to post replies to questions on a message board on their website (which was hosted by the company I was working for at the time), but the replies kept getting cut off at 5K. It turns out the firewall itself was truncating the POST requests.... So it wouldn't surprise me one bit if a badly behaving proxy server were converting POSTs to GETs -- especially if it were a proxy designed to cache requests (since you can more readily cache the response to a GET than the response to a POST).

    Spud Zeppelin * spud@spudzeppelin.com

      Hi, Have anyone found solution for above problem? If so I am eager to know that, which helps me in resoving my bug. Thanks.