diff --git a/docs/src/network.md b/docs/src/network.md index 4aadde01b4..57bf0856f8 100644 --- a/docs/src/network.md +++ b/docs/src/network.md @@ -575,7 +575,7 @@ To modify a response use [APIRequestContext] to get the original response and th ```js await page.route('**/title.html', async route => { // Fetch original response. - const response = await page.request.fetch(route.request()); + const response = await route.fetch(); // Add a prefix to the title. let body = await response.text(); body = body.replace('', '<title>My prefix:'); @@ -596,7 +596,7 @@ await page.route('**/title.html', async route => { ```java page.route("**/title.html", route -> { // Fetch original response. - APIResponse response = page.request().fetch(route.request()); + APIResponse response = route.fetch(); // Add a prefix to the title. String body = response.text(); body = body.replace("<title>", "<title>My prefix:"); @@ -615,7 +615,7 @@ page.route("**/title.html", route -> { ```python async async def handle_route(route: Route) -> None: # Fetch original response. - response = await page.request.fetch(route.request) + response = await route.fetch() # Add a prefix to the title. body = await response.text() body = body.replace("<title>", "<title>My prefix:") @@ -634,7 +634,7 @@ await page.route("**/title.html", handle_route) ```python sync def handle_route(route: Route) -> None: # Fetch original response. - response = page.request.fetch(route.request) + response = route.fetch() # Add a prefix to the title. body = response.text() body = body.replace("<title>", "<title>My prefix:") @@ -654,7 +654,7 @@ page.route("**/title.html", handle_route) await Page.RouteAsync("**/title.html", async route => { // Fetch original response. - var response = await Page.APIRequest.FetchAsync(route.Request); + var response = await route.FetchAsync(); // Add a prefix to the title. var body = await response.TextAsync(); body = body.Replace("<title>", "<title>My prefix:");