Summary of json usage

  • 2021-06-28 08:17:55
  • OfStack

Uses of JSON

Use JavaScript-based applications, including browser extensions and Web sites

Serialize and structured data transfer network connections using JSON format

This is mainly used for data transfer between the server and the Web application

Web services and API provide public data in JSON format

It can be used with modern programming languages

Characteristics of JSON

Easy to read and write JSON

Lightweight text-based interchange format

Independent Language

JSON format example:

&8226;Name/Value pair representation of data

&8226;Objects held in braces and each name followed by':'(colon), separation of name/value pairs, (comma)

&8226;Square brackets hold arrays and values, (comma) delimited.


{
  "book": [
  {
    "id":"01",
    "language": "Java",
    "edition": "third",
    "author": "Herbert Schildt"
  },
  {
    "id":"07",
    "language": "C++",
    "edition": "second"
    "author": "E.Balagurusamy"
  }]
}

JSON supported data types:

Type Description

Number's Double Precision Floating Point Format in JavaScript
String Double Quoted Backslash Escaped Unicode
Boolean * true or false
Ordered sequence of Array values
Value) It can be a string, a number, true or false (true/false), empty (null), etc.
Object Unordered Set Key-Value Pairs
Whitespace can use any pair of tokens
null [empty]


Related articles: