You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Adding Access-Control-Allow-Headers list to make rest call from a custom component

edited Apr 26, 2019 10:15AM in Visual Builder 5 comments

Summary

Adding Access-Control-Allow-Headers list to make rest call from a custom component

Content

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:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!