I know if I want to send an HTTP request, I can form it as a dictionary before sending it:
payload = dict(
username="something",
password="something_else"
)
r = requests.get('http://example.com', params=payload)
Does it do the opposite as well? If my request happens to redirect me to another URL, I can see where I was redirected with:
print r.url
But if that URL happens to be something like:
http://example.com/somepage.htm?varone=test&vartwo=3451&varthree=something
and I happen to want to pull out the vartwo from that URL (the string 3451), does the requests module provide any easy way to do this just by specifying that I want the value of "vartwo"? Another dictionary, or mapping object of some sort perhaps? Or is my only option to use urllib.unquote to decode the url, and parse it as a string?