It seems that when a key in data has a value of None, the key isn't included by requests.
>>> req = requests.Request('POST', 'http://google.com', data=dict(a=None, b=1))
>>> req.prepare().body
'b=1'
Why is this the case? I was expecting an empty string, or something like json.dumps(d) where None is rendered as null. I'm sure there's a good reason -- just curious about what it is. (One thing I can think of is that maybe there just isn't an encoding of null or None available to the POST request -- is that true?)
Additionally curious -- why does requests silently ignore such data instead of throwing an error?
Noneis a special class (python3.x) / type (python2.x) that's intentionally designed to denote the absence of a value. If you want an empty string, makeaan empty string (a=""). More info here