pythonoauthpython-requestsurllib3rauth

How can I see the actual data Requests sends over the wire?


(This is a follow-up question to this one)

How can I tell urllib3 to log the FULL request, including, but not limited to:

I am having trouble connecting to LinkedIn with OAuth (a similar implementation works with Google and Facebook), and I would like to see exactly what requests are being sent. I suspect the auth_token is not being provided, but I need to confirm this. For that, I need urllib3 to show the full requests, since they are over HTTPS and I can not analyze network traffic to see them (end-to-end encryption).


Solution

  • You can access the PreparedRequest object that was actually sent after the fact of a request by using the request accessor, e.g. print dir(r.request).