JSON stands for JavaScript Object Notation. JSON is a lightweight format for storing and transporting dataJSON is often used when data is sent from a server to a web page JSON is "self-describing" and easy to understand
Sample JSON
Following JSON contains address information with title "Mailing Address"
{
"title": "Mailing Address",
"Name": "Sidd B",
"country": "Japan",
"city": "Tokyo",
"zip": 334455,
"phone": [
{
"content": "123456",
"type": "home"
},
{
"content": "222222",
"type": "mobile"
},
{
"content": "33333",
"type": "mobile"
}
]
}
Following are the data types in JSON
JSON Datatypes
- string
- number
- object
- array
- boolean
- null
JSON Syntax Rules
- Data is in name/value pairs
- Data is separated by commas
- Curly braces hold objects
- Square brackets hold arrays