Data Formats: Difference between revisions
Jump to navigation
Jump to search
Line 26: | Line 26: | ||
= JSONP = | = JSONP = | ||
<pre> | <pre> | ||
functionCall({" | functionCall({ | ||
"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" | |||
} | |||
] | |||
} | |||
) | |||
</pre> | </pre> | ||
Revision as of 16:58, 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({ "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" } ] } )
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>