docs(python): fix example code of Route.fetch (#19840)

This commit is contained in:
Yusuke Iwaki 2023-01-04 04:05:09 +09:00 committed by GitHub
parent 9f27b300f4
commit b2820fccda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -454,7 +454,7 @@ page.route("https://dog.ceo/api/breeds/list/all", route -> {
```python async ```python async
async def handle(route): async def handle(route):
response = await route.fulfill() response = await route.fetch()
json = await response.json() json = await response.json()
json["message"]["big_red_dog"] = [] json["message"]["big_red_dog"] = []
await route.fulfill(response=response, json=json) await route.fulfill(response=response, json=json)
@ -464,7 +464,7 @@ await page.route("https://dog.ceo/api/breeds/list/all", handle)
```python sync ```python sync
def handle(route): def handle(route):
response = route.fulfill() response = route.fetch()
json = response.json() json = response.json()
json["message"]["big_red_dog"] = [] json["message"]["big_red_dog"] = []
route.fulfill(response=response, json=json) route.fulfill(response=response, json=json)