I'm using vue3 with axios and prisma but I'm having trouble getting user information.
My postman request works (http://localhost:3000/api/auth/user/7), but my axios request does not.
Can you help me?
async created () { const response = await axios.get('http://localhost:3000/api/auth/user/:id', { headers: { Authorization: 'Bearer ' localStorage.getItem('token') } }); console.log('ici'); }
axios does not support URL parameters.
One solution is to use template strings to build the request URL.
For example: