You need to sign in to do that
Don't have an account?
Surendra nune
Acess URL.getSalesforceBaseUrl().toExternalForm() from execute anonymous
Hi,
I need to set the CORS headers to an external system from Salesforce using http callouts.
To get the current request URL I know that we use,
But I need the url of visualforce page and Site in an apex controller which is not associated to any vf page for setting the cors headers.
How can I acheive this?
I need to set the CORS headers to an external system from Salesforce using http callouts.
To get the current request URL I know that we use,
URL.getSalesforceBaseUrl().toExternalForm()
But I need the url of visualforce page and Site in an apex controller which is not associated to any vf page for setting the cors headers.
How can I acheive this?
CORS loosens the browser Same Origin policy in a controlled manner, allowing JavaScript loaded from one origin, for example, https://myapp.herokuapp.com, to access an API in another, for example, https://na15.salesforce.com, by allowing the API server to provide a list of origins that may be permitted access.
Please follow the below link for more information
https://developer.salesforce.com/blogs/developer-relations/2015/01/spring-15-preview-cors-force-com-rest-api.html
Best Regards
Naga kiran