This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
get( url, [params] )
Make a GET request.
| Parameter | Type | Description |
|---|---|---|
| url | string / HTTP URL | Request URL (e.g. http://example.com). |
| params (optional) | object | Params object containing additional request parameters. |
Returns
| Type | Description |
|---|---|
| Response | HTTP Response object. |
Example fetching a URL
import http from 'k6/http';
export default function () {
const res = http.get('https://test.k6.io');
console.log(JSON.stringify(res.headers));
}

