Opened 9 years ago

Closed 9 years ago

#25026 closed New feature (needsinfo)

Should QueryDict accept "html json forms"?

Reported by: zauddelig Owned by: nobody
Component: HTTP handling Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by zauddelig)

On 23 may 2014 W3C published this working draft:
http://www.w3.org/TR/html-json-forms/

I'm focusing the attention on this paragraph:

User agents that implement this specification will transmit JSON data from their forms whenever the form's enctype attribute is set to application/json. During the transition period, user agents that do not support this encoding will fall back to using application/x-www-form-urlencoded. This can be detected on the server side, and the conversion algorithm described in this specification can be used to convert such data to JSON.'

Should Django QueryDict support this transition period and return data structures?

Here are some examples on how QueryDict should behave following the working draft:

>>> QueryDict("a=1&a=2")  # classical behavior
<QueryDict: {u'a': [u'1', u'2']}>
>>> QueryDict("a[0]=1&a[1]=2")  # the new behavior
<QueryDict: {u'a': [u'1', u'2']}>
>>> QueryDict("a[0]=1&a[1]=2")  # proposed to fix behavior
<QueryDict: {u'a[0]': [u'1'], u'a[1]': [u'2']}>

Change History (5)

comment:1 by zauddelig, 9 years ago

Description: modified (diff)

comment:2 by Tim Graham, 9 years ago

It may be a bit premature to implement functionality described in a working draft document. Can you provide any information about whether other projects are implementing its functionality?

comment:3 by zauddelig, 9 years ago

The draft was misinterpreted as a compliant client POST data would be found in request.body not in request.POST.

comment:4 by Tim Graham, 9 years ago

I'm not sure what you meant by that last comment. Was it a reply to my comment or something unrelated?

comment:5 by Tim Graham, 9 years ago

Resolution: needsinfo
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top