Adding Access-Control-Allow-Headers list to make rest call from a custom component
Summary
Adding Access-Control-Allow-Headers list to make rest call from a custom componentContent
Hi,
I am calling a rest api from a custom component passing some Headers.. But appn is not rendering in IE giving the below error:-
SEC7123: Request header kmauthtoken was not present in the Access-Control-Allow-Headers list.
kmauthtoken is my Header param name.
How can i pass this in the header list values in the Rest call ??
Thanks,
Sweta
Code Snippet
// Passing the en_US as the default header parameter
self.ep.initConfiguration({
headers: {
'kmauthtoken': '{\"localeId\":'+self.getLocale(self.properties.sessionLocaleCd)+',\"localeOverride\":\"true\"}'
}
});
self.ep.fetch().then(function(result) {
if (result.response.ok) {
alert("Success");
}
});
Tagged:
0