I use React and Axios for API consumption. When I try to append an endpoint I get this error:
'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status
But in Postman the endpoint works. In most of the solutions that I found on the net the problem is solved on the backend side. Unfortunately I do not have access to the backend. What can I do to solve the problem on the frontend side?
My request:
axios.post(`http://15.70.227.30:8345/my_api/login/`,
{
username: testApi,
password: 123456
})
.then((res) => return res)
.catch((err) => return err );