The situation is as follows:
Due to circumstances beyond my control, I'm writing a back-end which exposes data ONLY through JSON.
The UI is pure HTML/jQuery. All queries from the UI result in a JSON object (often quite complex). I need the UI to be able to pass me a complex object which includes multiple lists of Ids and strings.
What's the neatest way to implement this?
- Multiple GET/POST params, some of which are lists eg
&List=1,2,3 - A Full JSON Object as a single Param eg
?Data={"List"=[1,2,3]} - Something else entirely.
If you've done something similar, I'd be interested in your experiences - especially with regards to passing object definitions to the client.
In this instance, imagine the following Data packet...
{
Id: 1,
Status: "Processing",
RecordTypeAIds: (1,2,3)
RecordTypeBIds: (4,5,6)
RecordTypeCIds: null
}
What's the neatest way to send this information from jQuery to PHP (bearing in mind, lists may potentially be nested n-deep)
Thanks for any help you can provide.
php5tag?phpandphp5aren't synonyms and it seems that having a version in there provides additional information? Not to mention that this Q is over a year old and it's been fine so far - are there new guidelines?