Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to analyze Json format

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Today, I will talk to you about how to carry out Json format analysis, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

JSON (JavaScript Object Notation) is a lightweight data exchange format. Easy to read and understand, but also easy to machine parse and generate. JSON uses a language-independent text format, using habits similar to the C language family (including C language, JavaScript, Perl, Python, etc.). These features make JSON an ideal data exchange language.

A JSON is built on two structures:

A collection of name / value pairs (A collection of name/value pairs). It is understood as object (Object), record (Records), structure (struct), dictionary (dictionary), hash table (hash table), key list (keyed list), or associative array (associative array) worthy of ordered list (An ordered list of values) in different languages, and data (array) in most languages.

The form of JSON 1. Object

Object is an unordered collection of name / value pairs. An object begins with "{" (opening parenthesis) and ends with "}" (closing parenthesis). Each "name" is followed by a ":" (colon); "name / value" pairs are separated by "," (comma).

two。 Array

An array is an ordered collection of value. An array begins with "[" (opening square bracket) and ends with "]" (right square bracket). Values are separated by "," (comma).

Ternary content

Values (value) can be strings (string), numeric values (number), true, false, null, object, or array enclosed in double quotes. These structures can be nested.

A string (string) is a collection of any number of Unicode characters enclosed in double quotes, escaped using backslashes. A character (character) is a single string (character string).

The string (string) is very similar to the string of C or Java.

The value (number) is also very similar to the value of C or Java. Remove unused octal and hexadecimal formats. Remove some coding details.

Four examples

Note: strings must be enclosed in double quotation marks

Arrays and objects can be nested in an array

{"name": "BeJson", "url": "http://www.bejson.com"," page ": 88," isNonProfit ": true," address ": {" street ":" Science and Technology Park Road. "," city ":" Suzhou, Jiangsu "," country ":" China "} "links": [{"name": "Google", "url": "http://www.google.com"}, {" name ":" Baidu "," url ":" http://www.baidu.com"}, {"name": "SoSo" "url": "http://www.SoSo.com"}]} after reading the above content Do you have any further understanding of how to do Json format analysis? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 290

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report