我正在尝试使用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数据.