The fetch function should provide access to response headers.
()
| 268 | |
| 269 | |
| 270 | async 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 | |
| 281 | async def test_fetch_direct_chaining_with_error(): |