mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
13 lines
273 B
Python
13 lines
273 B
Python
from browser import fetch
|
|
|
|
|
|
def fetch_handler(res):
|
|
print(f"headers: {res['headers']}")
|
|
|
|
|
|
fetch(
|
|
"https://httpbin.org/get",
|
|
response_format="json",
|
|
headers={"X-Header-Thing": "rustpython is neat!"},
|
|
).then(fetch_handler, lambda err: print(f"error: {err}"))
|