Files
RustPython/wasm/demo/snippets/fetch.py
Rex Ledesma 4e2e0b41c6 chore: add ruff format --check (#5774)
* chore: add `ruff format --check`

* fix tests
2025-05-12 14:20:01 +09:00

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}"))