I've got some PHP code on my server that talks to my PostgreSQL database. My iPhone app communicates with the PHP via HTTP GETs/PUTs/POSTs (this is only running on mobile devices, not via browsers). I need to return a large JSON result from the query of the database. The query results will be dynamic, so one user isn't necessarily going to get the same response as another. I'm not sure of the exact size at the moment, but I'd hazard a guess it's probably going to be up to 1MB or so. So I have two questions:
- Can I return a fairly large JSON string in PHP in response to an HTTP GET request?
- Is there a maximum or best maximum size that should be returned via HTTP GET?
- If I can do #1, then the rest is moot. If, however, this is either not possible or not a good idea, what would be the alternative way to retrieve this data for the client?
Thanks!