How to authenticate the API with bearer token in K6..? Need help
@k6io2 жыл бұрын
Hi Saikiran! You can use headers to pass your bearer token. There's an example of how to use headers on these docs: k6.io/docs/using-k6/http-requests/
@aryandhakal112 жыл бұрын
@@k6io Hii, I cannot seem to find the required information about passing bearer token as header except in Examples section of the docs, but that portion is complex and hard to understand. Could you please help in this matter?
@zeeshan.anjum.junaidi2 жыл бұрын
@@aryandhakal11 You can use something like this. const result = http.get(secret_url.toString(), { headers: { Authorization: `Bearer ${auth_token}`, "Content-Type": "application/json" } }).json();
@srpelissier2 жыл бұрын
const failures = new Rate('failed requests') must be written 'failed_requests' to avoid the error "reason: no metric name "failed_requests" found"
@gravielsosa6882 жыл бұрын
you should change the thresholds by threshold, this change fixed my error