diff --git a/docs/sources/next/javascript-api/k6-experimental/browser/request/size.md b/docs/sources/next/javascript-api/k6-experimental/browser/request/size.md index a6b3e8a4e2..837d7480c6 100644 --- a/docs/sources/next/javascript-api/k6-experimental/browser/request/size.md +++ b/docs/sources/next/javascript-api/k6-experimental/browser/request/size.md @@ -9,9 +9,16 @@ Similar to Playwright's [`request.sizes()`](https://playwright.dev/docs/api/clas ### Returns -| Type | Description | -| ------ | ------------------------------------- | -| object | `{ body: , headers: }` | +| Type | Description | +| ------------- | ---------------------- | +| Promise | Returns [Size](#size). | + +### Size + +| Property | Type | Description | +| -------- | ------ | ---------------------------------- | +| body | number | Size in bytes of the request body. | +| headers | number | Size in bytes of the headers body. | ### Example @@ -40,7 +47,7 @@ export default async function () { const res = await page.goto('https://test.k6.io/'); const req = res.request(); - const size = await req.size(); + const size = req.size(); console.log(`size: ${JSON.stringify(size)}`); // size: {"headers":344,"body":0} } finally { await page.close();