Error: Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response

前端 未结 1 655
无人共我
无人共我 2020-12-10 17:07

I am building my application in Angular 2 and Laravel 5.4. Angular2 is for client side and laravel 5.4 is for server side. I created APIs in laravel and requesting those API

相关标签:
1条回答
  • 2020-12-10 18:06

    The errormessage is clear, 'Authorization' header is not allowed by your backend. In your backend Laravel application you have to set a response header containing:

    Access-Control-Allow-Headers : 'Content-Type', 'Authorization'
    

    see further documentation here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers

    0 讨论(0)
提交回复
热议问题