Skip to content

Commit 9ca09ac

Browse files
authored
Update documentation of compression in HTTP request (#1643)
* Update params.md in current * Update params.md in next
1 parent e624278 commit 9ca09ac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/sources/next/javascript-api/k6-http/params.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ _Params_ is an object used by the http.\* methods that generate HTTP requests. _
1818
| `Params.redirects` | number | The number of redirects to follow for this request. Overrides the global test option [`maxRedirects`](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference). |
1919
| `Params.tags` | object | Key-value pairs where the keys are names of tags and the values are tag values. Response time metrics generated as a result of the request will have these tags added to them, allowing the user to filter out those results specifically, when looking at results data. |
2020
| `Params.timeout` | string / number | Maximum time to wait for the request to complete. Default timeout is 60 seconds (`"60s"`). <br/> The type can also be a number, in which case k6 interprets it as milliseconds, e.g., `60000` is equivalent to `"60s"`. |
21-
| `Params.compression` | string | Sets whether the request body should be compressed. If set to `gzip` it will use gzip to compress the body and set the appropriate `Content-Length` and `Content-Encoding` headers.<br /><br />Possible values: `gzip`, `deflate`, `br`, `zstd`, and any comma-separated combination of them (for stacked compression) |
21+
| `Params.compression` | string | Sets whether the request body should be compressed. If set to `gzip` it will use gzip to compress the body and set the appropriate `Content-Length` and `Content-Encoding` headers.<br /><br />Possible values: `gzip`, `deflate`, `br`, `zstd`, and any comma-separated combination of them (for stacked compression). The default is no compression. |
2222
| `Params.responseType` | string | ResponseType is used to specify how to treat the body of the response. The three options are:<br />- text: k6 will return it as a string. This might not be what you want in cases of binary data as the conversation to UTF-16 will probably break it. This is also the default if<br />[discardResponseBodies](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference) is set to false or not set at all.<br />- `binary`: k6 will return an ArrayBuffer object<br />- `none`: k6 will return null as the body. The whole body will be ignored. This is the default when [discardResponseBodies](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference) is set to true. |
23-
| `Params.responseCallback` | [expectedStatuses](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/expected-statuses) | sets a [responseCallback](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/set-response-callback) only for this request. For performance reasons it's better to initialize it once and reference it for each time the same callback will need to be used |
23+
| `Params.responseCallback` | [expectedStatuses](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/expected-statuses) | sets a [responseCallback](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/set-response-callback) only for this request. For performance reasons it's better to initialize it once and reference it for each time the same callback will need to be used. |
2424

2525
### Example of custom HTTP headers and tags
2626

docs/sources/v0.52.x/javascript-api/k6-http/params.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ _Params_ is an object used by the http.\* methods that generate HTTP requests. _
1818
| `Params.redirects` | number | The number of redirects to follow for this request. Overrides the global test option [`maxRedirects`](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference). |
1919
| `Params.tags` | object | Key-value pairs where the keys are names of tags and the values are tag values. Response time metrics generated as a result of the request will have these tags added to them, allowing the user to filter out those results specifically, when looking at results data. |
2020
| `Params.timeout` | string / number | Maximum time to wait for the request to complete. Default timeout is 60 seconds (`"60s"`). <br/> The type can also be a number, in which case k6 interprets it as milliseconds, e.g., `60000` is equivalent to `"60s"`. |
21-
| `Params.compression` | string | Sets whether the request body should be compressed. If set to `gzip` it will use gzip to compress the body and set the appropriate `Content-Length` and `Content-Encoding` headers.<br /><br />Possible values: `gzip`, `deflate`, `br`, `zstd`, and any comma-separated combination of them (for stacked compression) |
21+
| `Params.compression` | string | Sets whether the request body should be compressed. If set to `gzip` it will use gzip to compress the body and set the appropriate `Content-Length` and `Content-Encoding` headers.<br /><br />Possible values: `gzip`, `deflate`, `br`, `zstd`, and any comma-separated combination of them (for stacked compression). The default is no compression. |
2222
| `Params.responseType` | string | ResponseType is used to specify how to treat the body of the response. The three options are:<br />- text: k6 will return it as a string. This might not be what you want in cases of binary data as the conversation to UTF-16 will probably break it. This is also the default if<br />[discardResponseBodies](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference) is set to false or not set at all.<br />- `binary`: k6 will return an ArrayBuffer object<br />- `none`: k6 will return null as the body. The whole body will be ignored. This is the default when [discardResponseBodies](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference) is set to true. |
23-
| `Params.responseCallback` | [expectedStatuses](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/expected-statuses) | sets a [responseCallback](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/set-response-callback) only for this request. For performance reasons it's better to initialize it once and reference it for each time the same callback will need to be used |
23+
| `Params.responseCallback` | [expectedStatuses](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/expected-statuses) | sets a [responseCallback](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/set-response-callback) only for this request. For performance reasons it's better to initialize it once and reference it for each time the same callback will need to be used. |
2424

2525
### Example of custom HTTP headers and tags
2626

0 commit comments

Comments
 (0)