Open Ramil001 opened 1 year ago
Hi @Ramil001, thanks for reporting your issue.
The error you're seeing is because of a CORS (cross-origin resource sharing) restriction. Browsers supporting CORS (all popular browsers) will block requests if the server doesn't return an appropriate Access-Control-Allow-Origin header.
This is an issue with the way your API is set up; axios is working fine.
Another tip: The way your code is currently set up, the request would be made every single time App
is rendered. Instead, your axios call should be inside a useEffect
hook.
Hope I could help!
I'm this problem too
I create react app and i have get data from webservices prestashop 1.7
I have result error CORS
In postman all is good
rapid good
Why this axios not working in react? Why my code is bad?