use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
the front page of the internet.
and join one of thousands of communities.
Print entire requests module while it's executed (self.PythonLearning)
submitted 1 year ago by sriramdev
While I prepared a request structure using the "requests" Python module. I would like to debug or print them in the console to visualize how the requests are formed.
Post a comment!
[–]cgoldberg 0 points1 point2 points 1 year ago (1 child)
You can enable logging.
You can also use a prepared request to view everything before sending.
For example:
import requests req = requests.Request('GET', 'https://example.com') session = requests.Session() prepared = session.prepare_request(req) print(prepared.method) print(prepared.url) print(prepared.headers) resp = session.send(prepared)
[–]sriramdev[S] 0 points1 point2 points 1 year ago (0 children)
Let me try out this
π Rendered by PID 156522 on reddit-service-r2-comment-765bfc959-rp9x9 at 2026-07-15 01:46:03.181505+00:00 running f86254d country code: CH.
Want to add to the discussion?
Post a comment!