python - how does QueryDict split HttpRequest query -
example:
>>> django.http import querydict >>> q = querydict('a=x&b=y&c=z') >>> q <querydict: {u'a': [u'x'], u'c': [u'z'], u'b': [u'y']}> >>> q = querydict('a=x&b=y&c=z+1') >>> q <querydict: {u'a': [u'x'], u'c': [u'z 1'], u'b': [u'y']}> >>> ^
why '+' replaced space?
+
reserved shorthand notation space.
to represent +
, use %2b
:
>>> querydict('a=x&b=y&c=z%2b1') <querydict: {u'a': [u'x'], u'c': [u'z+1'], u'b': [u'y']}>
Comments
Post a Comment