相关疑难解决方法(0)

我的传入Django请求中的JSON数据在哪里?

我正在尝试使用Django/Python处理传入的JSON/Ajax请求.

request.is_ajax()True请求,但我不知道有效负载在哪里与JSON数据.

request.POST.dir 包含这个:

['__class__', '__cmp__', '__contains__', '__copy__', '__deepcopy__', '__delattr__',
 '__delitem__', '__dict__', '__doc__', '__eq__', '__ge__', '__getattribute__',
'__getitem__', '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__',
 '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', 
'__setattr__', '__setitem__', '__str__', '__weakref__', '_assert_mutable', '_encoding', 
'_get_encoding', '_mutable', '_set_encoding', 'appendlist', 'clear', 'copy', 'encoding', 
'fromkeys', 'get', 'getlist', 'has_key', 'items', 'iteritems', 'iterkeys', 'itervalues', 
'keys', 'lists', 'pop', 'popitem', 'setdefault', 'setlist', 'setlistdefault', 'update', 
'urlencode', 'values']
Run Code Online (Sandbox Code Playgroud)

请求帖子键中显然没有键.

当我在Firebug中查看POST时,请求中会发送JSON数据.

python django ajax json content-type

146
推荐指数
9
解决办法
16万
查看次数

标签 统计

ajax ×1

content-type ×1

django ×1

json ×1

python ×1