【发布时间】:2014-06-28 23:26:45
【问题描述】:
我的 Ajax 调用中有数据:
data: { hint: {'asdf':4} },
我觉得我应该能够访问这个对象
request.POST['hint'] # and possibly request.POST['hint']['asdf'] to get 4
但是这个错误来了。我看看
MultiValueDictKeyError at /post_url/
"'hint'"
当我打印帖子数据时,我得到了奇怪的错误字典:
<QueryDict: {u'hint[asdf]': [u'4']}>
我应该如何正确传递数据,以便我在 Python 中保留相同的结构并像在 JS 中一样使用它?
【问题讨论】:
标签: jquery python ajax django post