luwu 6 ajax往django传递字符串数组 - nuanxin1111/react GitHub Wiki

  1. 数据格式
x = {para:['a', 'b', 'c']}
  1. data中的设置 data: $.param(x)
  2. django中接收的数据 request.POST是django定义的 QueryDict对象,如果直接去request.POST.get('x')则获得的是'c', 若要取得所有数据,则需要用request.POST.getlist('x')