You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: add section on following redirects to HTTP requests (#1628)
* chore: add section on following redirects to HTTP requests
* Update docs/sources/next/using-k6/http-requests.md
Co-authored-by: Mihail Stoykov <[email protected]>
* chore: apply to v0.52.x
---------
Co-authored-by: Mihail Stoykov <[email protected]>
Copy file name to clipboardExpand all lines: docs/sources/next/using-k6/http-requests.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,13 @@ The [http module](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-htt
66
66
|[put()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/put)| Issue an HTTP PUT request. |
67
67
|[request()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/request)| Issue any type of HTTP request. |
68
68
69
+
## Follow redirects
70
+
71
+
By default, k6 automatically follows a set number of redirects before stopping and returning the last response. You can customize this by using:
72
+
73
+
- The `maxRedirects` option to customize the number of redirects globally. Refer to [Max redirects](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference/#max-redirects) for more details.
74
+
- The `Params.redirects` property to customize the number of redirects for a specific request, which overrides the `maxRedirects` option. Refer to [Params](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/params/) for more details.
75
+
69
76
## HTTP Request Tags
70
77
71
78
k6 automatically applies [tags](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/tags-and-groups#section-tags) to your HTTP requests.
Copy file name to clipboardExpand all lines: docs/sources/v0.52.x/using-k6/http-requests.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,13 @@ The [http module](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-htt
66
66
|[put()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/put)| Issue an HTTP PUT request. |
67
67
|[request()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/request)| Issue any type of HTTP request. |
68
68
69
+
## Follow redirects
70
+
71
+
By default, k6 automatically follows a set number of redirects before stopping and returning the last response. You can customize this by using:
72
+
73
+
- The `maxRedirects` option to customize the number of redirects globally. Refer to [Max redirects](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options/reference/#max-redirects) for more details.
74
+
- The `Params.redirects` property to customize the number of redirects for a specific request, which overrides the `maxRedirects` option. Refer to [Params](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-http/params/) for more details.
75
+
69
76
## HTTP Request Tags
70
77
71
78
k6 automatically applies [tags](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/tags-and-groups#section-tags) to your HTTP requests.
0 commit comments