Type in your question below and we'll check to see what answers we can find...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Desktop, Windows 10, Chrome
My Question or Issue
Hi, I'm making a react web app using Axios for fetch requests. My app already correctly sets a token and receives data from API endpoints such as 'https://api.spotify.com/v1/me/playlists'. All endpoints are working except PUT request endpoints. HOWEVER, if I use the developer console for PUT requests, they will work correctly, even using the token I get from my app.
The error: status: 401, message: "No token provided"
Example code request:
Solved! Go to Solution.
Hey thanks for the replies, i finally found a solution online. (alvaron, your solution had the same issue 'no token provided')
The problem is with Axios requests, for whatever reason the headers are not being sent in put/post requests but does with get, unless you structure the request differently.
To fix the issue I had to change how the request was written for put/post requests, see below: