Data Formats: Difference between revisions
Jump to navigation
Jump to search
Created page with "= JSON = <pre> { "firstName": "John", "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", ..." |
|||
Line 25: | Line 25: | ||
= JSONP = | = JSONP = | ||
<pre> | |||
functionCall({"Name": "Foo", "Id": 1234, "Rank": 7}) | |||
</pre> | |||
= XML = | = XML = |
Revision as of 16:57, 10 December 2013
JSON
{ "firstName": "John", "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021" }, "phoneNumber": [ { "type": "home", "number": "212 555-1234" }, { "type": "fax", "number": "646 555-4567" } ] }
JSONP
functionCall({"Name": "Foo", "Id": 1234, "Rank": 7})
XML
<pre> <person> <firstName>John</firstName> <lastName>Smith</lastName> <age>25</age> <address> <streetAddress>21 2nd Street</streetAddress> <city>New York</city> <state>NY</state> <postalCode>10021</postalCode> </address> <phoneNumbers> <phoneNumber type="home">212 555-1234</phoneNumber> <phoneNumber type="fax">646 555-4567</phoneNumber> </phoneNumbers> </person> <person firstName="John" lastName="Smith" age="25"> <address streetAddress="21 2nd Street" city="New York" state="NY" postalCode="10021" /> <phoneNumbers> <phoneNumber type="home" number="212 555-1234"/> <phoneNumber type="fax" number="646 555-4567"/> </phoneNumbers> </person>