-1

I was trying an API which is deployed in AWS API gateway.
And when I call post request to that API endpoint by AXIOS in my react app, its getting CORS error. I tried to add headers like Access-Control-Allow-Origin but its not working at all. But its working in postman.
Here's my code snippet and the error showing in the console.
P.S. As its a public API, I replaced my original url with the word "URL" and I maked it with red in error message.

Screen Shot Code Snippet

Error

But If I add Access-Control-Allow-Origin in headers the error looks like below

Error 2

Sifat Amin
  • 793
  • 3
  • 10

0 Answers0