Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
datajunkie1000
Contributor III
Contributor III

CORS error when accessing Talend API from React

Hi All

I have a React application which uses the Axios library to GET data from the Talend API. My request works in Postman but when I run it from React I get

 

Access to XMLHttpRequest at 'https://api.us.cloud.talend.com/v1/management/roles/[role id]/users' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

xhr.js:177 GET https://api.us.cloud.talend.com/v1/management/roles/[role id]/users net::ERR_FAILED

Has anyone been able to get API calls working from a browser application? My headers are (with the apostrophes removed)

 

Access-Control-Allow-Origin:http://localhost:3000,

Content-Type: application/json,

Authorization:Bearer [auth token]

 

I also tried

 Access-Control-Allow-Origin: *

Content-Type: application/json,

Authorization:Bearer [auth token]

 

Thanks!

Labels (2)
0 Replies