MCPcopy Create free account
hub / github.com/0x676e67/wreq-python / print_response_info

Function print_response_info

python/examples/impersonate.py:6–23  ·  view source on GitHub ↗

Helper function to print response details Args: resp: Response object from the request

(resp: Response)

Source from the content-addressed store, hash-verified

4
5
6async def print_response_info(resp: Response):
7 """Helper function to print response details
8
9 Args:
10 resp: Response object from the request
11 """
12 async with resp:
13 print("\n=== Response Information ===")
14 print(f"Status Code: {resp.status_code}")
15 print(f"Version: {resp.version}")
16 print(f"Response URL: {resp.url}")
17 print(f"Headers: {resp.headers}")
18 print(f"Encoding: {resp.encoding}")
19 print(f"Content-Length: {resp.content_length}")
20 print(f"Remote Address: {resp.remote_addr}")
21 print(f"Peer Certificate: {resp.peer_certificate()}")
22 print(f"Content: {await resp.text()}")
23 print("========================\n")
24
25
26async def request_firefox():

Callers 2

request_firefoxFunction · 0.85
request_chrome_androidFunction · 0.85

Calls 2

peer_certificateMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected