From 72fa945689c499780865475cf88843d2c9377fb1 Mon Sep 17 00:00:00 2001 From: aesyondu <57334943+aesyondu@users.noreply.github.com> Date: Thu, 27 Feb 2020 02:58:37 +0800 Subject: [PATCH] Update request.respond to request.fulfill (#1123) --- docs/api.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api.md b/docs/api.md index 463f99a319..8faa0f7f94 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1235,9 +1235,9 @@ The `format` options are: - returns: <[Promise]>. Routing activates the request interception and enables `request.abort`, `request.continue` and -`request.respond` methods on the request. This provides the capability to modify network requests that are made by a page. +`request.fulfill` methods on the request. This provides the capability to modify network requests that are made by a page. -Once request interception is enabled, every request matching the url pattern will stall unless it's continued, responded or aborted. +Once request interception is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. An example of a naïve request interceptor that aborts all image requests: ```js @@ -2997,7 +2997,7 @@ An example of fulfilling all requests with 404 responses: ```js await page.route('**/*', request => { - request.respond({ + request.fulfill({ status: 404, contentType: 'text/plain', body: 'Not Found!' @@ -3006,7 +3006,7 @@ await page.route('**/*', request => { ``` > **NOTE** Mocking responses for dataURL requests is not supported. -> Calling `request.respond` for a dataURL request is a noop. +> Calling `request.fulfill` for a dataURL request is a noop. #### request.headers() - returns: <[Object]> An object with HTTP headers associated with the request. All header names are lower-case.