Introduction-to-JSON
Introduction-to-JSON
What is JSON?
- JSON stands for JavaScript Object Notation
- JSON is lightweight text-data interchange format
- JSON is language independent
- JSON is "self-describing" and easy to understand
Example
{
"id":1,
"name":"Anoop",
"billingAddress":[{"city":"Bangalore"}]
}
JSON Syntax
- Data is in name/values pairs
- Data is seperated by commas
- Curly braces hold objects
- Square brackets hold arrays
JSON object
- JSON object are written inside curly brackets
- Object can contain multiple name/values pairs separated by comma
- Names in objects are supposed to be unique