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
We have specific authentication flow that requires to attach custom header to every request. I wrote extension that can generate header but attaching it to request is manual process. Sample:
Header has to be generated for every request so i cannot initialize it once in setup. It would be great to be able to somehow modify request before execution.
Suggested Solution (optional)
I see a couple of options here:
Add ability to attach some function for modification request like
Thanks for opening this issue and sorry for the slow reply! It's a known problem that was previously mentioned in #761 (and probably in other new-http issues) that we'd like to address with a new k6 HTTP API soon (#2461).
For now, the httpx JavaScript library that we host on jslib.k6.io might be sufficient for your needs. It's a wrapper around the existing k6/http API, take a look:
This won't be implemented in the current HTTP API, and since there's a workaround with the httpx library, I'll close this issue.
Request modification is a feature we'd like to have in the new HTTP API (initial design document), which we're starting to work on now. We're still ironing out the design and syntax, so feel free to follow the issue and document for details.
Feature Description
We have specific authentication flow that requires to attach custom header to every request. I wrote extension that can generate header but attaching it to request is manual process. Sample:
Header has to be generated for every request so i cannot initialize it once in setup. It would be great to be able to somehow modify request before execution.
Suggested Solution (optional)
I see a couple of options here:
Personally i'd prefer second option as it can give more flexibility.
The text was updated successfully, but these errors were encountered: