requests
requests copied to clipboard
cookies.get behavior
trafficstars
Pardon me... I'm not proficient in python... This library appears to be the de-facto reference for http clients in other programming languages as well..
it seems like many http get clients return raw cookie values. and require raw cookie names... because... that's what this library does
The subtitle for this project is "http for humans"....
This human isn't interested in the transport-layer encoding.. I want the human value
With all that said... why :
Expected Result
I would expect response.cookies.get() to
a) expect a decoded name as a parameter and
b) return a decoded (human) value
Actual Result
Encoded value returned if name was encoded for http transport... I must pass encoded name to get value
response headers:
Set-Cookie: dingus=foo%3Bbar; path=/
Set-Cookie: a%3Bb=foo%3Bbar; path=/
[nav] In [1]: import requests
[ins] In [2]: r = requests.get('http://localhost/cookietest')
[ins] In [3]: r.cookies.get('dingus')
Out[3]: 'foo%3Bbar'
[ins] In [4]: r.cookies.get('a;b')
[ins] In [5]: r.cookies.get('a%3Bb')
Out[5]: 'foo%3Bbar'