import { HTTPRequest } from "https://deno.land/x/pptr@1.2.0/mod.ts";
Fulfills a request with the given response.
Examples
An example of fulfilling all requests with 404 responses:
An example of fulfilling all requests with 404 responses:
await page.setRequestInterception(true);
page.on('request', request => {
request.respond({
status: 404,
contentType: 'text/plain',
body: 'Not Found!'
});
});
NOTE: Mocking responses for dataURL requests is not supported.
Calling request.respond
for a dataURL request is a noop.
Parameters
response: ResponseForRequest
- the response to fulfill the request with.