Extracting items out of a QueryDict

后端 未结 8 1216
清酒与你
清酒与你 2020-12-29 07:04

I have a querydict that looks like the following:


How would I extract

8条回答
  •  鱼传尺愫
    2020-12-29 07:38

    I just experienced the same problem. It happened when I was trying to have my request data be held in request.POST instead of request.body. I was using Django with a trusted backend route already configured to work with request.POST

    In order to send the data within request.POST with the fetch API I had to use 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' which turned my JSON stringifed data into a format like above.

    In learning how to serialize data from Daniel's answer I came across $.param(data), a jquery function which should format it correctly for you.

提交回复
热议问题