Dec 01 2019 06:10 PM
Error I receive in the browser:
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.
Any Suggestions
Dec 01 2019 06:52 PM
Hi,
CORS error will appear,when you are trying to invoke the API which is not hosted in your domain.
If you can modify the hosted API configuration,you can allow CORS on the API,otherwise you need to build some proxy to invoke the request.
Readymade proxy will be heroku one
https://cors-anywhere.herokuapp.com/
There are some side effects to it as well,like since this is hosted publicly ,you might experience slowness if heroku one takes time to process your request.
you can build your own custom proxy as well and host it in your organization.
Dec 01 2019 07:00 PM
Dec 13 2022 11:13 PM - edited Dec 13 2022 11:14 PM
Dec 13 2022 11:13 PM - edited Dec 13 2022 11:14 PM
Hi @TarundeepSinghTheta , just wondering if you found any solution for this. I'm also facing the same. I found one article by @Ravichandran K (https://ravichandran.blog/2021/09/25/accessing-third-party-api-without-cors-error-in-spfx-using-azur...) I'm looking for some other ways apart from this (azure function app). I'm trying to access yammer post api mentioned here https://learn.microsoft.com/en-us/rest/api/yammer/group_membershipsjsongroup_idid