fulfillRequest
open suspend override fun fulfillRequest(responseCode: Int, responseHeaders: List<Fetch.HeaderEntry>?, binaryResponseHeaders: String?, body: String?, responsePhrase: String?)
Provides response to the request.
Parameters
responseCode
An HTTP response code.
responseHeaders
Response headers.
binaryResponseHeaders
Alternative 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
A 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
A textual representation of responseCode. If absent, a standard phrase matching responseCode is used.