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

Function main

python/examples/request.py:6–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6async def main():
7 resp: rnet.Response = await rnet.request(Method.GET, url="https://www.google.com/")
8 print("Status Code: ", resp.status_code)
9 print("Version: ", resp.version)
10 print("Response URL: ", resp.url)
11 print("Headers: ", resp.headers)
12 print("Cookies: ", resp.cookies)
13 print("Content-Length: ", resp.content_length)
14 print("Encoding: ", resp.encoding)
15 print("Remote Address: ", resp.remote_addr)
16 print("Headers set-cookie: ", resp.headers["set-cookie"])
17
18 for key in resp.headers:
19 print(key)
20
21 for key, value in resp.headers.items():
22 print(f"{key}: {value}")
23
24 for cookie in resp.cookies:
25 print(cookie)
26
27
28if __name__ == "__main__":

Callers 1

request.pyFile · 0.70

Calls 2

itemsMethod · 0.80
requestMethod · 0.45

Tested by

no test coverage detected