What is the difference between
SP.RequestExecutor. From what I have seen
SP.WebProxy.invoke is used to call a completely external service most of the time, but I am struggling to find out when should I use which?
In order to perform remote requests outside the SP environment (unlike
SP.RequestExecutor) you must first whitelist domains using the app manifest file, then you can use
SP.WebProxy.invoke to perform a HTTP operations to these sites.
SP.WebProxy.invoke will take your request and forward it to the server, then the server will do the request on your behalf using the instructions you give it, then return the results back to you. This enables you to buypass domain restrictions otherwise enforced by the browser.