#fetch options
3 messages · Page 1 of 1 (latest)
Hey, you can check the TypeScript types to see which options the useFetch has.
For headers, it's
const { data } = await useFetch(() => `https://jsonplaceholder.typicode.com/todos/1`, {
headers: new Headers({
'authorization': 'Bearer 123',
}),
})
You can create yourself a composable that wraps useFetch and then intercept it by always adding that option besides the others