mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
18 lines
390 B
Python
18 lines
390 B
Python
import asyncweb
|
|
import browser
|
|
|
|
|
|
async def main(delay):
|
|
url = f"https://httpbin.org/delay/{delay}"
|
|
print(f"fetching {url}...")
|
|
res = await browser.fetch(
|
|
url, response_format="json", headers={"X-Header-Thing": "rustpython is neat!"}
|
|
)
|
|
print(f"got res from {res['url']}:")
|
|
print(res, end="\n\n")
|
|
|
|
|
|
for delay in range(3):
|
|
asyncweb.run(main(delay))
|
|
print()
|