Highlighted

API CORS error

New Here ,
Apr 20, 2020

Copy link to clipboard

Copied

Hi I am just starting to work with APIs.  I am having issues with the CORS error below [edited websites]. 

 

Access to XMLHttpRequest at 'https://api.test.xxx.com/access' from origin 'https://yyy.zzz.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

 

The company we are working with does not want to add the Access-Control-Allow-Origin header.  What is the best way to proceed in ColdFusion? Any suggestions are greatly appreciated.

Thanks

Nicole

 

Views

537

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

API CORS error

New Here ,
Apr 20, 2020

Copy link to clipboard

Copied

Hi I am just starting to work with APIs.  I am having issues with the CORS error below [edited websites]. 

 

Access to XMLHttpRequest at 'https://api.test.xxx.com/access' from origin 'https://yyy.zzz.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

 

The company we are working with does not want to add the Access-Control-Allow-Origin header.  What is the best way to proceed in ColdFusion? Any suggestions are greatly appreciated.

Thanks

Nicole

 

Views

538

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 20, 2020 0
Adobe Community Professional ,
Apr 20, 2020

Copy link to clipboard

Copied

If you're ok with fetching the data with ColdFusion itself, just use CFHTTP to do so, then process whatever needs to be processed, then output it to the browser. CORS only affects cross-origin requests made by browsers.

 

Dave Watts, Eidolon LLC

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 20, 2020 0
New Here ,
Apr 27, 2020

Copy link to clipboard

Copied

Thank you

I got it to work on CF18 but not on CF11 with cfhttp.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 27, 2020 0
Adobe Community Professional ,
Apr 29, 2020

Copy link to clipboard

Copied

Nicole, since you're using an https URL for your cfhttp call, your issue with CF11 will likely be just down to having an outdated JVM (that CF is using). That's easily solved. For more, see my post here: https://coldfusion.adobe.com/2019/06/error-calling-cf-via-https-solved-updating-jvm/

 

Let us know if that gets you going there.

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 29, 2020 0