Relative Content

Tag Archive for reactjshttpaxiostokenhttp-status-code-401

401 error in axios post method in react project

So, I have to add a product to the basket in the project I wrote with React. But I get a 401 error, while I send the access token in the header.When logging in, I store the tokens locally, and I have also created a component called useAxios. But I don’t know how to use it, there is a mistake somewhere. Endpoints are all okey, so no problem
Can someone explain what the problem is, thanks in advance.