There is no set limit on the size of a JSON response, any more than there is
on an HTML or XML response. You can have very large JSON responses with no
problem.

GET vs. POST would have nothing to do with this. Those are only different in
the way the request is sent to the server; the response format for GET and
POST is identical.

When you say "it fails", what fails? Is the server failing to generate a
complete JSON response? Is it being generated OK but running into trouble in
the browser? What exactly is failing and how?

-Mike

> From: thephatp
> 
> I'm employing the getJSON call in a site I'm working on, but 
> I'm having a problem with the response not coming through if 
> it is too large.
> 
> I've read a number of posts talking about the request string 
> being too large (forcing a user to use POST), but what about 
> the response string being too large?  Would switching to POST 
> fix this?
> 
> The data coming back could be broken down into smaller 
> portions and requested separately, but this seems like way 
> overkill for what I'm needing to do, not to mention that it's 
> a nightmare trying to get it all to return in the correct 
> order (since some later requests complete before the most recent one).
> 
> My current test is requesting about 50 objects (each with 
> about 20 fields), but it fails after about 10 (scarcely 
> populated) objects.  As an alternative, I grabbed all 50 id's 
> to the objects (in MySQL database), and then proceeded to 
> request each one individually.
> However, since the request is asynchronous, I'm getting what 
> should be ordered results back, which isn't good.
> 
> So, I see two alternatives:
> 
> (1) Find a way to request all the data up front in a single 
> call (very preferable).
> 
> (2) Request each one individually as described above, and 
> store the values in a new javascript class, then re-order 
> afterward.  This seems like overkill, and I hope I don't have 
> to go here.
> 
> 
> Does anyone have any suggestions for #1 above or even another 
> alternative solution?  I'm all ears (or eyes in this case).
> 
> Thanks in advance for any help you can provide!
> 
> Chad

Reply via email to