且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python POST请求找不到数据属性

更新时间:2022-01-05 19:38:39

您无需对data进行JSON编码,因为您无需在视图中使用JSON进行任何操作.只需将您的字典直接传递到data:

You don't need your data to be JSON encoded, as you're not doing anything with JSON in your view. Simply pass your dictionary directly to data:

response = requests.post(url, data=data, headers=headers)