SWR support header parameters? #466
Answered
by
sergiodxa
rootlinux2
asked this question in
General
-
How can I pass header parameters like auth_token? |
Beta Was this translation helpful? Give feedback.
Answered by
sergiodxa
Jun 15, 2020
Replies: 1 comment 1 reply
-
In your fetcher you can use any header you want, if you want to receive them dynamically you can pass an array as key of useSWR function fetcher(url, token) {
// fetch
}
useSWR([endpoint, token], fetcher) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rootlinux2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In your fetcher you can use any header you want, if you want to receive them dynamically you can pass an array as key of useSWR