docs(python): Add await to response.json() for async ApiResponse class example (#35503)

This commit is contained in:
Ekwinder 2025-04-07 12:26:25 +05:30 committed by GitHub
parent 54a9ae2b8d
commit aec54fa573
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -13,7 +13,8 @@ async def run(playwright: Playwright):
assert response.ok
assert response.status == 200
assert response.headers["content-type"] == "application/json; charset=utf-8"
assert response.json()["name"] == "foobar"
json_data = await response.json()
assert json_data["name"] == "foobar"
assert await response.body() == '{"status": "ok"}'