← Back to Audits domain
Audits.getEncodedResponse
Returns the response body and size if it were re-encoded with the specified settings. Only
applies to images.
Domain: Audits
experimental
Parameters
| Name | Type | Description |
requestId | Network.RequestId | Identifier of the network request to get content for. |
encoding | string | The encoding to use. |
quality (optional) | number | The quality of the encoding (0-1). (defaults to 1) |
sizeOnly (optional) | boolean | Whether to only return the size information (defaults to false). |
Returns
| Name | Type | Description |
body | string | The encoded body as a base64 string. Omitted if sizeOnly is true. (Encoded as a base64 string when passed over JSON) |
originalSize | integer | Size before re-encoding. |
encodedSize | integer | Size after re-encoding. |
Example Request
{
"id": 1,
"method": "Audits.getEncodedResponse",
"params": {
"requestId": "request-1",
"encoding": "encoding-value"
}
}
Example Response
{
"id": 1,
"result": {
"body": "body-value",
"originalSize": 1,
"encodedSize": 1
}
}
Usage in Node.js
const result = await send('Audits.getEncodedResponse', {"requestId": "request-1", "encoding": "encoding-value"});
console.log(result);
// {"body": "body-value", "originalSize": 1, "encodedSize": 1}