JSON
JSON
Definition: JavaScript Object Notation
- First standardized in 2013 in RFC 8259
- Easier for humans to read and work with than XML
- Can be imported directly into JavaScript, which is commonly used on the internet
- White Space is insignificant
- RESTful APIs often use JSON
Extra deets:
- JSON is a series of keys and their values
- Keys are always strings
- Values can be one of four primitive data types
- Keys and Values are separated by colons :
- Each Key-Value Pairs is separated by commas
- JSON primitive Data Types
- String
- Number
- Boolean
- Null
- JSON structured data types
- Object (or Dictionary)
- An unordered list of key-value pairs encapsulated in curly brackets and separated by commas
- Array
- A series of values encapsulated in brackets and separated by commas
- Object (or Dictionary)
JSON Sample
"ArrayOfObjects":[
{
"name":"Object1",
"number":420,
"boolean_value":false,
"ArrayofNumbers":[420,69,3],
"Nullvalue":,
},
{
"name":"Object2",
"ipaddress":"192.168.1.1"
}
]