from django.core.serializers import serialize import json
word_list=serialize('json',pa.page(1))
HttpRequest(json.dumps(),content_type="application/json")
- 编码:把一个Python对象编码转换成Json字符串 json.dumps()
在Http请求中,我们每天都在使用Content-type来指定不同格式的请求信息
1. Content-Type
Content-Type来表示具体请求中的媒体类型信息。
- application/json : JSON数据格式