A while ago, I had noticed that when encoding a map name: value
to 'application/x-www-form-urlencoded
, it renders something like that (here I use Python):
>>> from urllib import urlencode
>>> urlencode({'hello': '', 'blabla': 'hihi'})
'blabla=hihi&hello='
But the parsing (at least with Python), just strips the pairs that have an empty value :
>>> from urlparse import parse_qs
>>> parse_qs('blabla=hihi&hello=')
{'blabla': ['hihi']}
So ... is it the standard behaviour ? Where can I find the reference on how www-form-urlencoded
should be parsed ? I have googled a while, found the RFCs for uris, W3c docs for forms, and so on but nothing about how the empty values should be treated. Can somebody give me a pointer to that ???