我正在使用Requests库将数据发送到服务器,使用以下代码:
r=requests.post(
url='http://localhost:8000/api/open/',
data=json.dumps({"name":"awdawd"}),
headers={'content-type':'aplication/json'},
)
但是,我收到以下错误:
"error_message": "The format indicated 'aplication/json' had no available deserialization method. Please check your ``formats`` and ``content_types`` on your Serializer."
有没有人对此有所了解?
非常感谢
答案 0 :(得分:2)
它只是在应用程序中拼写错误
r=requests.post(url='http://localhost:8000/api/open/',
data=json.dumps({"name":"awdawd"}),
headers={'content-type':'application/json'})