Interceptor Angular 4.3 - Set multiple headers on the cloned request

后端 未结 4 1678
夕颜
夕颜 2020-12-16 10:47

I just noticed that the Header Object that was possible to use in the previous HTTP RequestsOption is not anymore supported in the new Interceptor.

It\'s the new Int

4条回答
  •  独厮守ぢ
    2020-12-16 11:37

    My code worked with the following approach to add new headers to replace previous values by new values:

    headers: req.headers.set('token1', 'asd')
    .set('content_type', 'asd')
    .set('accept', 'asd')
    

提交回复
热议问题