Jul 17 2019 08:10 PM
How can I make a cross-domain request in a Client Side Web Part built with the SharePoint Framework? My need is to access SharePoint 2016 data from a SharePoint 2016 site in another domain (same credentials).
I found a crossDomainWeb method in the documentation for the add-in model, but nothing for SPFx.
Jul 18 2019 02:14 AM
@Christophe Humbert SharePoint 2016 doesn't provide an easy way to configure CORS to allow for cross-domain calls. Easiest way in my experience is to create a custom Web API to perform and expose the SharePoint operations required and host it in the domain where your SPFx components reside.
Jul 22 2019 02:30 AM
You can use the Dev PnP JS library in SPFx to make cross-site collection calls.
The setup is very straight forward and will help you with other complex REST API calls as well.
https://pnp.github.io/pnpjs/documentation/getting-started/
https://github.com/SharePoint/PnP-JS-Core/wiki/Configuration