how to set headers in jquery ajax call? -
i using web service rest, requires 2 headers finicity-app-key
, content-type
. in site's example partner authentication, use curl
, sends 2 headers. when try set in jquery, if check network tab in dev tools, don't see 2 headers on ajax made. seem show under access-control-request-headers
content-type,finicity-app-key
.
does 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)); } });
try this
$.ajax({ url: 'your url', headers: { 'finicity-app-key': 'a0874b0eda76ae7918c779f8eeef92c1a' } });
Comments
Post a Comment