python preparedrequest

Solutions on MaxInterview for python preparedrequest by the best coders in the world

showing results for - "python preparedrequest"
Mila
22 Mar 2019
1The Request is turned into a requests.PreparedRequest when it is sent with .post() or .get(). Unfortunately that doesn't have the unencoded data available anymore.
2
3What you can get from a POST response is login_response.request.body, but that has been encoded as form data at this point.
4
5To turn it back into a nice to use dict you can use this:
6
7# py2
8import urlparse
9dict(urlparse.parse_qsl(login_response.request.body))
10or
11
12# py3
13from urllib.parse import parse_qsl
14dict(parse_qsl(login_response.request.body))