JSON is JavaScript Object Notation, it is minimal and readable format for structuring the data. It is used to communicate between server and web application. It is an alternative of XML.
JSON Rules:
1. It is always written in curly braces {}.
2. Data is written in Key, Value pair.
3. Key can have more than one value.
JSON Example:
{
"Title": "Spiderman"
"Year": "1990"
"Released": "N/A"
"Producer" : ["Name1","Name2"]
}
4. If a key has more than one value, it would be stored in an Array.
In the above example, Title is the key and Spiderman is its value. And the producer key contains more the one value and stored in an Array like [].
5. Keys can have sub keys and Values, known as Object.
JSON Example:
{
"fields": {
"summary" : {
"details" : "True"
}
Here "fields" is an object.
JSON Rules:
1. It is always written in curly braces {}.
2. Data is written in Key, Value pair.
3. Key can have more than one value.
JSON Example:
{
"Title": "Spiderman"
"Year": "1990"
"Released": "N/A"
"Producer" : ["Name1","Name2"]
}
4. If a key has more than one value, it would be stored in an Array.
In the above example, Title is the key and Spiderman is its value. And the producer key contains more the one value and stored in an Array like [].
5. Keys can have sub keys and Values, known as Object.
JSON Example:
{
"fields": {
"summary" : {
"details" : "True"
}
Here "fields" is an object.
No comments:
Post a Comment