Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

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

Ekwinderaec54fa5739e
diff --git a/docs/src/api/class-apiresponse.md b/docs/src/api/class-apiresponse.md
index 5a901b76ba..468a5a830d 100644
--- a/docs/src/api/class-apiresponse.md
+++ b/docs/src/api/class-apiresponse.md
@@ -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"}'