非application/x-www-form-urlencoded的POST请求
request.POST只能处理header是application/x-www-form-urlencoded的POST请求
其他header类型的请求request.POST为空
处理方法
通过request.body属性获取最原始的请求体数据,request.body返回bytes类型。
#请求体是json格式的
json_data = json.loads(request.body) #dict
print(type(json_data))
#输出
<class 'dict'>
request.GET.get(‘param’)获取uri参数