MCPcopy Index your code
hub / github.com/pyscript/pyscript / test_fetch_response_headers

Function test_fetch_response_headers

core/tests/python/tests/test_fetch.py:270–278  ·  view source on GitHub ↗

The fetch function should provide access to response headers.

()

Source from the content-addressed store, hash-verified

268
269
270async def test_fetch_response_headers():
271 """
272 The fetch function should provide access to response headers.
273 """
274 response = await fetch("https://jsonplaceholder.typicode.com/todos/1")
275 assert response.ok
276 # Access headers through the underlying response object.
277 content_type = response.headers.get("content-type")
278 assert "application/json" in content_type
279
280
281async def test_fetch_direct_chaining_with_error():

Callers

nothing calls this directly

Calls 2

fetchFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected