How to correctly set Http Request Header in Angular 2

前端 未结 7 1958
终归单人心
终归单人心 2020-11-27 06:10

I have an Ionic 2 application using Angular 2, which is sending an Http PUT to a ASP.NET Core API server. Here\'s the method I\'m using to send the request:



        
7条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 07:02

    You have a typo.

    Change: headers.append('authentication', ${student.token});

    To: headers.append('Authentication', student.token);

    NOTE the Authentication is capitalized

提交回复
热议问题