on 2023 Jan 04 1:08 PM
Hi,
we have a requirement to get data in fiori application from CPI. We are going to deploy this app on On-Premise system.
while performing Ajax call I'm getting 401 error.
If I double-click on this link, I can can get the data in browser.
Following is my Ajax call in controller
I try adding this URL "https://cors-anywhere.herokuapp.com" with my CPI link but it's not working, here I get 401 Unauthorized error. and if I execute this link in browser I get "Missing required request header. Must specify one of: origin,x-requested-with
Also I add chrome extension for CORS, it is also not working.
Any help would be much appreciated.
Regards,
Priyanka
Request clarification before answering.
priyanka.punde , as stated in my blog, none of the options are for productive environments. You don't fix CORS issues in the frontend app as the "problem" happens on the backend response.
As you're calling an CPI endpoint, you must enable CORS on CPI itself. Follow the steps on this tutorial, it may help:
Configure SAP API Management policies to avoid CORS issues and generate an API Key
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
11 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.