Why do you have to understand JSON?
So naturally the next question would be, where will i get to see this data in browser?
Right click ->inspect element -> Network tab -> Response
Example:-
First let’s look at the basics of client-server communication. In all the web based application, the client(user’s browser) sends request for certain details to the server. Server processes the request and compose the response to be sent. This response can be of any format- JSON, XML, CSV etc.
The classic approach in the past was to respond the client request with relevant HTML page in response. That simply means lot of processing and time lags for all the instances where only data was required. The client server communication was made more lighter by client handling the UI aspect and server returning the required details which will be mapped back to relevant fields on to the UI, sounds like a more sorted approach.
JSON structure
in such scenarios, use tools like JSON formatter to beautify the data in more readable format.Or you can also use tools like Postman to check the response, where the formatted response is rendered.
Tools to keep handy
Types supported in JSON
JSON file supports following types of data to be composed.
- Strings “Example”
- Numbers 10 , 1.5, -80 etc
- Boolean
- null
- Arrays [1,2,3]
- Object {“id”, “101”}
Advantages of JSON
- JSON is preferable format due to its lightweight and clean approach.
- Simple and easily understandable.
- Wide range of browser compatibility.
- JSON storage is optimal.
- Easy array storage and parsing.
Disadvantages
- The format is not fully secure.
- Limited support for data types
Leave a Reply