错误消息:指示的格式没有可用的反序列化方法

时间:2014-04-05 13:50:52

标签: python json django tastypie

我正在使用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."

有没有人对此有所了解?

非常感谢

1 个答案:

答案 0 :(得分:2)

它只是在应用程序中拼写错误

r=requests.post(url='http://localhost:8000/api/open/',                
                data=json.dumps({"name":"awdawd"}),
                headers={'content-type':'application/json'})