json.dump(
obj,
fp,
*,
skipkeys=False,
ensure_ascii=True,
check_circular=True,
allow_nan=True,
cls=None,
indent=None,
separators=None,
default=None,
sort_keys=False,
**kw,
)
If specified, ``separators`` should be an ``(item_separator, key_separator)``
tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and
``(',', ': ')`` otherwise. To get the most compact JSON representation,
you should specify ``(',', ':')`` to eliminate whitespace.
separators默认多分隔符为(', ', ': '),里面带有空格,在返回前段多时候,如果空字符带上,会消耗传输速度。
indent参数可以在调试模式设置为4,这样显示多返回数据看起来比较好
ensure_ascii设置为False,返回给前段中文不会转化为asc。
sort_keys参数,排序选项
