mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
13 lines
285 B
Python
13 lines
285 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}"))
|