Could anyone provide guidance on how to convert the given curl command into an ajax/xmlhttpsrequest format?
curl -d "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="04717761766a65696139717761766a65...
I have attempted to replicate the functionality with two different code examples, but unfortunately, it is not working as expected:
1)
var req = new XMLHttpRequest();
req.open( "POST", "https://login.salesforce.com/services/oauth2/token", true);
req.setRequestHeader('Accept', 'application/json');
req.send();
2)
$.ajax({
url: myUrl,
headers: myHeaders,
type: 'POST',
processData: false,
contentType: false,
}).complete(function ( data ) {
console.log(data.responseText);
});