SoFunction
Updated on 2024-11-15

Python commonly used json standard library

When the request headers, add a name for Accept, the value of application/json header (i.e., "I" (the browser) to receive data in json format), so that the request to the server to return may not necessarily be an HTML page, but may be may also be a JSON document.

1. Data exchange format -- JSON (JavaScript Object Notation)

http 1.1 Specifications

  • The process of requesting a special encoding is called content negotiation in the http1.1 specification.

JSON Features

  • JSON is the most successful data exchange format used on the Internet;
  • Easy to understand and lightweight;
  • It can be transmitted more efficiently than older XML;
  • JSON is not only easy for humans to read and write, but also easy for machines to generate and parse;

2. json standard library under python

>> import json
  • load/dump
  • loads/dumps
>> s = ('Aroma')
>> s
'"\\u9999"'
>> (s)
'Fragrance'

summarize

Above is the entire content of this article, I hope the content of this article for your study or work has a certain reference learning value, thank you for your support. If you want to know more about the content please check the following related links