我下面的字tastypie教程字,直到我到达后部分: http://django-tastypie.readthedocs.org/en/latest/interacting.html#creating-a-new-resource-post无JSON对象可以被解码 - tastypie - 卷曲
当我运行此命令我不断收到以下错误: No JSON object could be decoded
我检查了一下,我确定我正在逐字处理文档。
感谢您的帮助
我下面的字tastypie教程字,直到我到达后部分: http://django-tastypie.readthedocs.org/en/latest/interacting.html#creating-a-new-resource-post无JSON对象可以被解码 - tastypie - 卷曲
当我运行此命令我不断收到以下错误: No JSON object could be decoded
我检查了一下,我确定我正在逐字处理文档。
感谢您的帮助
原来是一个窗户的东西与cURL。
如进行转义:那么,这样的:
curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"body": "This will prbbly be my lst post.", "pub_date": "2011-05-22T00:46:38", "slug": "another-post", "title": "Another Post", "user": "/api/v1/user/1/"}' http://localhost:8000/api/v1/entry/
应该是:
curl --dump-header - -H "Content-Type: application/json" -X POST --data "{\"body\": \"This will prbbly be my lst post.\", \"pub_date\": \"2011-05-22T00:46:38\", \"slug\": \"another-post\", \"title\": \"Another Post\", \"user\": \"/api/v1/user/1/\"}" http://localhost:8000/api/v1/entry/
感谢您更新此答案,我有完全相同的问题! – 2012-09-25 08:06:41