This repository has been archived by the owner on Dec 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Pass functions in as header values #120
Labels
Comments
If the |
I'd argue it is a default option if every request requires it. For my specific use case I need a header to be sent with a variable value always derived from the same function. However, that header needs to be sent on every request. From my perspective it's default behavior to always send that header. |
This is what I'm trying to avoid. qwest.post('/things', {}, { headers: { 'MyHeader': myFunc() } }) qwest.get(`/things/${id}`, {}, { headers: { 'MyHeader': myFunc() } }) qwest.get('/things', {}, { headers: { 'MyHeader': myFunc() } })
|
Ok. I'll take a look at this as soon as possible ;) |
Or you can make a PR if you need this quickly |
It still seems weird to me to support that kind of feature in qwest since it just matches a really specific case. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It would be nice if you could specify a function as a header value so you could have a set of default headers that may be calculated per request.
The text was updated successfully, but these errors were encountered: