Answer the question
In order to leave comments, you need to log in
HttpClient not sending requests without subscribe?
Actually, the question is, is it normal that calling the get method of the HttpClient class, which is not followed by the subscribe method, does not lead to a request to the resource?
The request is like this:
this._httpClient.get('http://localhost:20019/api', { responseType: "text", withCredentials: true });
Answer the question
In order to leave comments, you need to log in
Try httpClient.get(...).toPromise() , inside there will be a subscription and folding the result into a Promise. And the Promise itself can be "postponed for later" or thrown away :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question