You need to sign in to do that
Don't have an account?
REST API - CORS Error
Hi,
I am doing the integration between salesforce to UI (Jquery). When I hit the url in web browser and send the call out to salesforce I am getting the below error.
https://xxxxxxxxxxxxx/services/apexrest/CreateCase. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://xxxxxxxxxxxxx' is therefore not allowed access. The response had HTTP status code 401.
In salesforce I added the url in remote site settings and in CORS whie list.
From UI part in Jquery enabled cors. From SOAP UI Toll I was able to send call out and get the response.
But from original server I am facing the above error.
Is there any settings missed in salesforce or jquery.
This is critical to me. Please any one suggest me.
I appreciate the help to resolve this issue.
Thanks in advance,
Lakshmi
1. https://jvaneyck.wordpress.com/2014/01/07/cross-domain-requests-in-javascript/
2. http://www.html5rocks.com/en/tutorials/cors/
Check this blog post which helps to create the jQuery application with the salesforce REST API https://developer.salesforce.com/blogs/developer-relations/2015/08/creating-jquery-application-using-rest-api.html You can try the above approaches to avoid the CROS error