最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Sending a large parametrized data set as a GET request - Stack Overflow

programmeradmin3浏览0评论

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 plex data set that has nestings within it, and json fits the bill well.

Thanks for your help.

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 plex data set that has nestings within it, and json fits the bill well.

Thanks for your help.

Share Improve this question edited Jun 4, 2010 at 19:56 Claudiu 230k173 gold badges503 silver badges699 bronze badges asked Jun 4, 2010 at 19:17 premjgpremjg 5825 silver badges12 bronze badges 2
  • Can you specify what you mean by "large"? – Pekka Commented Jun 4, 2010 at 19:22
  • What are the design limitations which makes POST unusable? Its limit is much higher. – BalusC Commented Jun 4, 2010 at 20:04
Add a ment  | 

1 Answer 1

Reset to default 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 es 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:

  • MSDN: Maximum URL length is 2083 characters in Internet Explorer
  • Various server and browser tests, from 2006 but should still give a half-way representative overview
发布评论

评论列表(0)

  1. 暂无评论