4

What's the best way to send a large data set via a GET request.

  • I cannot use POST because of some design limitations.
  • I can use jQuery or any other library, sizzle is preferable.
  • I have a complex data set that has nestings within it, and json fits the bill well.

Thanks for your help.

Claudiu
  • 224,032
  • 165
  • 485
  • 680
premjg
  • 582
  • 5
  • 12

1 Answers1

8

GET requests shouldn't exceed 1-4 kilobytes in size due to browser and server limitations. You would have to split your request in chunks to do this.

If the data comes from a form, you could, for example utilize jQuery's .serialize() function to put the data into one string. Then split the string into kilobyte-sized chunks and send it out using Ajax. You would have to have a server-side script that glues the chunks back together, possibly using a unique identifier specified in the Ajax requests.

Some sources on the length limitation:

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • 2
    [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.2.1) mentions 255 bytes as safe upper limit. It's however an old spec. Nowadays I think 2K is safe, but I am unsure about mobile clients. The limit by the way doesn't apply on query stirng part only, but on the entire URI. – BalusC Jun 04 '10 at 20:00