I am using a web service with rest, but it requires two headers Finicity-App-Key and Content-Type. In the site's example for
Partner Authentication, they use curl and it sends it with the two headers. But when I try to set it in jquery, if I check the network tab in dev tools, I don't see those two headers on the ajax I made. They seem to show under access-control-request-headers like content-type,finicity-app-key.
Does anyone know what's wrong?
Thanks
https://developer.finicity.com/admin/docs
$.ajax({
type: "POST",
url: "https://api.finicity.com/aggregation/v2/partners/authentication",
dataType: "xml",
contentType: "application/xml",
data : '<credentials><partnerId>24455d81430647</partnerId><partnerSecret>v09TAUzbYgsfKnbTFOGn0</partnerSecret></credentials>',
beforeSend: function (xhr) {
xhr.setRequestHeader('Finicity-App-Key', 'a0874b0eda76ae7918c779f8eeef92c1a');
xhr.setRequestHeader('Content-Type', 'application/xml');
},
success: function(response){
alert(response);
},
error: function(xhr,status,error){
alert("Error:" + JSON.stringify(xhr));
}
});