Angular http.post without .subscribe callback

后端 未结 5 2169
野的像风
野的像风 2020-12-05 23:56

I\'m wondering if I can make just a http post request without subscribing on callbacks, something like this

 this._http.post(\'/list/items/u         


        
5条回答
  •  没有蜡笔的小新
    2020-12-06 00:08

    I do not think you can.

    http.post (and get, put, delete, etc) returns a cold Observable, i.e. an Observable for which:

    its underlying producer is created and activated during subscription

    Source.

    This means the function represented by the Observable is activated only with the subscribe() method.

提交回复
热议问题