This is nothing to do with Angular. You need to reconfigure your API server: https://www.w3.org/TR/cors/
You probably need to add the custom header to the Access-Control-Expose-Headers value. Look for a middleware for your server technology (ex. for ExpressJS: https://www.npmjs.com/package/cors). On Thu, Apr 25, 2019 at 5:59 AM NANA DARKO <[email protected]> wrote: > I am making a request to an API and passing a customized header but i get > this error: > > Access to XMLHttpRequest at 'https://<port>/payment-providers/list/ > <https://www.google.com/url?q=https%3A%2F%2Fadb1-api.mesika.org%3A44443%2Fbulkpayment-api%2Fbank%2Fpayment-providers%2Flist-bank-sort-codes%2F&sa=D&sntz=1&usg=AFQjCNHOiYRYgoOZuuQ_MhCGOBUGDe4_og>' > from origin 'http://localhost:4200' has been blocked by CORS policy: > Request header field x-corporate-auth-token is not allowed by > Access-Control-Allow-Headers in preflight response. > > Please I need your assistance to resolve this as soon as possible. > > -- > You received this message because you are subscribed to the Google Groups > "Angular and AngularJS discussion" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- Lucas Lacroix Computer Scientist System Technology Division, MEDITECH <http://ehr.meditech.com> 781-774-2293 -- <https://ehr.meditech.com/expanse> <https://www.linkedin.com/company/meditech> <https://twitter.com/MEDITECH> <https://www.facebook.com/MeditechEHR> Subscribe <https://info.meditech.com/get-great-meditech-content?hsCtaTracking=864299ec-5abf-4004-9c6d-2d051794101f%7Cc911be42-538a-4a48-8dca-a6d4001c6326> to receive emails from MEDITECH or to change email preferences. -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
