A blog for technology, SEO tips, website development and open source programming.

Introduction to JSON Basics

0 757

jsonJSON (JavaScript Object Notation) is one of the most popular and widely accepted data exchange format originally specified by Douglas Crockford.

It is currently described by two competing standards, RFC 7159 and ECMA-404. The ECMA standard is minimal, describing only the allowed grammar syntax, whereas the RFC also provides some semantic and security considerations.

  1. JSON is widely accepted in the softwares that includes client-server architecture for exchanging data between client and server.
  2. JSON is easy to use and purely text-based, lightweight, and human- readable format and people often misunderstand as replacement of XML.
  3. Although the abbreviation starts with JavaScript, JSON is not a language or have any language literals it just a specification for notation of data.
  4. It is platform and language independent and inbuilt supported by almost all of the front line languages/frameworks like and support for the JSON data format is available in all the popular languages, some of which are C#, PHP, Java, C++, Python, and Ruby.
  5. The official Internet media type for JSON is application/json.
  6. The JSON file name extension is .json.

Tip:An Internet media type is a standard identifier used on the Internet to indicate the type of data that a file contains.

Web Architecture Media Types

A typical web application transfers data between client and server. The client can be a web browser, mobile app, mobile browser and server can be application developed using Java or .NET. Client request to server by request methods such as GET, POST, PUT and DELETE, using standard protocols such as http, https, ftp etc. Depending on the request method, client sends data to server with any of the standard media types. Some of the accepted media types are as follows.

  • application/json
  • application/atom+xml
  • application/vcard+xml
  • text/plain
  • application/mp4

Where JSON is used?

JSON media type widely used in web architecture for transferring data between server and client.

Prior to JSON, XML was considered to be the chosen data interchange format for most of the cases. XML is heavy weight, it consumes more of network bandwidth in comparison to JSON. XML data is considerably complex for parsing. It requires an XML DOM implementation on the client side that would accept the XML response and convert into client program understandable format. It is often time consuming to implement in client side and it requires the complete XML DOM to be loaded into memory while parsing it.

 

JSON answers the problem to XML. It is lightweight and plain text type syntax, makes it easy to learn and understand. Most modern browser JavaScript engines are capable of handling JSON Parsing with almost no coding.

 

Notice that the size of the XML document is quite large compared to its representation in JSON. This result significant impact for larger size documents when used with real time applications.

Mobile is one of the counterpart of todays business. Which means if not today, tomorrow you will require your services to be accessible on mobile. As mobile devices are limited in memory and power, transmitting larger chunk of data is not recommended.

Thus JSON become one of the most preferred media format for data exchange between client and server.

5 JSON Online Tools

Leave a Reply

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More