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
I'm using useSWR to fetch data from an API and need to access both the data and the response headers. However, I couldn't find any information in the documentation on how to retrieve headers alongside the data. Ideally, I would like the result to look something like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using useSWR to fetch data from an API and need to access both the data and the response headers. However, I couldn't find any information in the documentation on how to retrieve headers alongside the data. Ideally, I would like the result to look something like this:
Is there a way to retrieve headers with useSWR, or would I need to modify my fetcher function? If so, could you provide an example of how to do this?
Beta Was this translation helpful? Give feedback.
All reactions