Angular 2 And Controlling HTTP Request and Response

前端 未结 2 1129
無奈伤痛
無奈伤痛 2021-01-24 20:12

In Angular 2 I am trying to control http request/response to set/read some headers when sending request and getting response.

I just override HttpRequest like this, and

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-24 20:55

    You can't override Response I remember seeing that it is being created using new Response in one of the related Http classes instead of requesting it from the injector, which is reasonable because Response needs to be a dufferent instance for each request.

提交回复
热议问题