0

So, I need to be able to return large amounts of data from a database for graphing purposes. Currently, I'm using GET via ajax and simply generating the necessary html via php. This works fine for small amounts of data, but whenever I request more than about a year's worth, I get error 414. Does anyone have suggestions of better ways to do this, or know how to change the limit? Thanks in advance.

anonymouse
  • 639
  • 1
  • 8
  • 18
  • 1
    urls are length-limited. passing more than (at most) 512 chars in a url is just asking for trouble. Use POST instead. – Marc B Apr 01 '13 at 18:45

1 Answers1

1

You shouldn't be getting a 414 error with the size of the return data from the server, there is no hard limit on the size of an http response.

You WILL get an error with the size of the URL you are using to SEND the ajax request, since there are hard limits.

By all means switch to using POST in your ajax calls, ensure that you are sending the data via key/value pairs (not stitched onto the URL itself), and you shouldn't see the error any longer.

See here for info on URL limits in different browsers (tl;dr stay under 2000):

What is the maximum length of a URL in different browsers?

Community
  • 1
  • 1
jszobody
  • 28,495
  • 6
  • 61
  • 72