th1nkgr33n
Missing custom header when calling API from mounted() hook in NUXT2
I have a component inside a NUXT2.17.0 project.
When I call an API inside that component, this API should return a custom header.
If I do the call inside an fetch() hook, it returns that custom header. But if I call the API inside the mounted()-hook no custom headers are included.
It doesn't matter if I use axios or fetch native. None of them works, so it must be something with the lifecycle mounted.
Someone has an idea? Thanks
19 replies