Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Django Tastypie中检索通过curl发送的json数据?_Json_Django_Curl_Tastypie - Fatal编程技术网

如何在Django Tastypie中检索通过curl发送的json数据?

如何在Django Tastypie中检索通过curl发送的json数据?,json,django,curl,tastypie,Json,Django,Curl,Tastypie,我通过curl命令发送json数据。我如何取回它 这是我的curl命令 curl -XPOST -i -g http://localhost:8000/api/v1/controllers/register/ -H "content-type: application/json" -d '{"installation_id": 1, "name":"xyz"}' 这是我的看法 def api_controllers_register(self,bundle,**kwargs):

我通过curl命令发送json数据。我如何取回它

这是我的
curl
命令

 curl -XPOST -i -g http://localhost:8000/api/v1/controllers/register/ -H "content-type: application/json" -d '{"installation_id": 1, "name":"xyz"}'
这是我的看法

def api_controllers_register(self,bundle,**kwargs):
        print "bundle",bundle.data
在url前加前缀

def prepend_urls(self):
        return [
            url(r"^(?P<resource_name>%s)/lastevent%s$" % (self._meta.resource_name, trailing_slash()), self.wrap_view('api_controllers_register'), name="api_controllers_register"),
               ]

如何检索json数据?

我遵循以下命令print request.body

"'WSGIRequest' object has no attribute 'data'",