← Back to Fetch domain

Fetch.fulfillRequest

Provides response to the request.

Domain: Fetch stable

Parameters

NameTypeDescription
requestIdRequestIdAn id the client received in requestPaused event.
responseCodeintegerAn HTTP response code.
responseHeaders (optional)arrayResponse headers.
binaryResponseHeaders (optional)stringAlternative way of specifying response headers as a \0-separated series of name: value pairs. Prefer the above method unless you need to represent some non-UTF8 values that can't be transmitted over the protocol as text. (Encoded as a base64 string when passed over JSON)
body (optional)stringA response body. If absent, original response body will be used if the request is intercepted at the response stage and empty body will be used if the request is intercepted at the request stage. (Encoded as a base64 string when passed over JSON)
responsePhrase (optional)stringA textual representation of responseCode. If absent, a standard phrase matching responseCode is used.

Example Request

{
  "id": 1,
  "method": "Fetch.fulfillRequest",
  "params": {
    "requestId": "request-1",
    "responseCode": 1
  }
}

Example Response

{
  "id": 1,
  "result": {}
}

Usage in Node.js

const result = await send('Fetch.fulfillRequest', {"requestId": "request-1", "responseCode": 1});
console.log(result);