JSON (JavaScript Object Notation) is an open-standard file format or data interchange format that uses human-readable text to transmit data objects consisting of attribute – value pairs and array data types (or any other serializable value). It is a very common data format, with a diverse range of applications, such as serving as replacement for XML in AJAX systems.
JSON is a language-independent data format. It was derived from JavaScript, but many modern programming languages include code to generate and parse JSON-format data. The official Internet media type for JSON is application/json. JSON file names use the extension .json .
Features of JSON
ββ¬Easy to use – JSON API offers high-level facade, which helps you to simplify commonly used use-cases;
Performance – JSON is quite fast as it consumes very less memory space, which is especially suitable for large object graphs or systems;
Free tool – JSON library is open source and free to use.
Doesn’t require to create mapping – Jackson API provides default mapping for many objects to be serialized;
Clean JSON – Creates clean, and compatible JSON result that is easy to read;
Dependency – JSON library does not require any other library for processing.
A JSON object contains data in the form of a key/value pair. The keys are strings and the values are the JSON types. Keys and values are separated by colon. Each entry (key/value pair) is separated by comma. The { (curly brace) represents the JSON object.Β Example of JSON is provided below.
Important benefits/ pros of using JSON:
- Provide support for all browsers
- Easy to read and write
- Straightforward syntax
- You can natively parse in JavaScript using eval() function
- Easy to create and manipulate
- Supported by all major JavaScript frameworks
- Supported by most backend technologies
- JSON is recognized natively by JavaScript
- It allows you to transmit and serialize structured data using a network connection
- You can use it with modern programming languages
- JSON is text which can be converted to any object of JavaScript into JSON and send this JSON to the server
