Forum Discussion

Akli_Bellahoues's avatar
Akli_Bellahoues
Copper Contributor
Dec 04, 2023

Cross-domain requests in SPFx - SharePoint 2019

Hi 

 

I have 3 site collections with different hostnames within the same web application.

I have developed a SPFX web part deployed on one of these site collections.

I am trying to retrieve data from the 2 other site collections using the SharePoint Rest Apis in my SPFX web part.

However, I am getting CORS policy errors : Access to fetch at '' from origin '' 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

 

How I can fix this problem ?

 

Thanks a lot for your help

 

 

No RepliesBe the first to reply

Resources