What is JSON?
Options
- A JavaScript framework that is used for building web apps
- A lightweight text format for data, with
{}objects and[]arrays (Correct option) - A database engine that stores documents as binary files
- A binary image format that is commonly used on the web
Answer
A lightweight text format for data, with objects {} and arrays []
Why
JSON (JavaScript Object Notation) is plain text that both humans and programs read easily: {"name": "Ana", "skills": ["python", "sql"]}.
It is the most common format for API requests and responses.
In Python, json.dumps(obj) turns a dict into JSON text and json.loads(text) does the reverse.
Remember
JSON = the text format APIs speak.