Django+postman——postman发送raw请求时django接口request.POST获取数据为空

目录

  • 1.报错信息
  • 2.解决办法
  • 3.总结

django.utils.datastructures.MultiValueDictKeyError

1.报错信息

使用request.POST[‘a’]获取数据时报错

django.utils.datastructures.MultiValueDictKeyError: 'a'

postman发送请求时接收数据失败
postman配置及结果如下:
Django+postman——postman发送raw请求时django接口request.POST获取数据为空_第1张图片
Django+postman——postman发送raw请求时django接口request.POST获取数据为空_第2张图片
视图逻辑如下:

@csrf_exempt
def add(request):
	print(request

你可能感兴趣的:(python,python,django,post,postman)