Pages

2013-03-26

JSON

JSON (JavaScript Object Notation) is a text-based open standard designed for human-readable data interchange.

The JSON format is often used for serializing and transmitting structured data over a network connection. 

It is used primarily to transmit data between a server and web application, serving as an alternative to XML.

------ from WIKI


The following is an example of JSON format data :

{
   "1":{
      "actions":4095,
      "buffers":256,
      "capabilities":199,
      "datapathId":"00:00:00:00:00:00:00:01",
      "length":176,
      "port":[
         {
            "name":"s1-eth2",
            "state":0,
            "portNumber":2,
            "hardwareAddress":"a2:11:3e:5c:fa:7c",
            "config":0,
            "currentFeatures":192,
            "advertisedFeatures":0,
            "supportedFeatures":0,
            "peerFeatures":0
         },
         {
            "name":"s1",
            "state":1,
            "portNumber":-2,
            "hardwareAddress":"8a:c9:7b:68:97:42",
            "config":1,
            "currentFeatures":0,
            "advertisedFeatures":0,
            "supportedFeatures":0,
            "peerFeatures":0
         },
         {
            "name":"s1-eth1",
            "state":0,
            "portNumber":1,
            "hardwareAddress":"72:37:87:bc:08:b4",
            "config":0,
            "currentFeatures":192,
            "advertisedFeatures":0,
            "supportedFeatures":0,
            "peerFeatures":0
         }
      ],
      "tables":-1,
      "type":"FEATURES_REPLY",
      "version":1,
      "xid":3
   }
}


It was composed of "object node", "array node" and "data".
For example, {name:valueis an object node.
An object node is started from "{" and ended of  "}".
And an array node is started from "[" and ended of  "]".
Besides, there may be some object nodes in the array node.



References : http://en.wikipedia.org/wiki/JSON







No comments:

Post a Comment