httpx
Note
The source code for this library can be found in the grafana/k6-jslib-httpx GitHub repository.
The httpx
module is an external JavaScript library that wraps around the native k6/http module.
It’s an HTTP client with features that are not yet available in the native module.
- Ability to set HTTP options globally (such as timeout).
- Ability to set default tags and headers that will be used for all requests.
- More user-friendly arguments to request functions (get, post, put take the same arguments).
The httpx
module integrates well with the expect library.
Caution
This library is in active development. It’s stable enough to be useful, but you can watch the GitHub repository to be notified when a new version is released.