I am trying to get data from the Salesforce API using the SOQL method. The problem is that when sending an ajax get request, it encodes the url, which causes the $ ajax request to fail.
How to send a simple url to ajax request without encoding url.
Sample request HERE:
$.ajax({
type: "GET",
url: "https://ap1.salesforce.com/services/data/v35.0/query?q=SELECT Id FROM Contact WHERE Email= '" + Email + "'",
headers: {
"Authorization": "OAuth " + access_token,
'Content-Type': 'text/plain'
},
crossDomain: true,
dataType: 'application/json',
success: function (responseData) {
console.log(responseData);
},
error: function (request, status, error) {
console.log(request.responseText);
}
});
source
share