How to use the k6/encoding.b64encode function in k6

To help you get started, we’ve selected a few k6 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github grafana / grafana / devenv / docker / loadtest / modules / client.js View on Github external
beforeRequest(params) {
    params = params || {};
    params.headers = params.headers || {};
    let token = `${this.username}:${this.password}`;
    params.headers['Authorization'] = `Basic ${encoding.b64encode(token)}`;
  }
}