Application behavior

HTTP Client

Observe when requests start, how unsubscription cancels work, and what progress and error events look like.

Angular 22.3.2 · trace
Lesson flow Request. Subscribe. Events. Result.
Request
Subscribe
Events
Result

Objective

Follow an HttpClient request from subscription to a response, a failure, or cancellation.

Transcript

Angular 22.3.2

  1. HttpClient request observables start work on subscription. Subscribing twice can create two independent requests.
  2. The fixture uses Angular’s testing backend to observe dispatch, unsubscription, download progress, and the completed response.
  3. A simulated HTTP failure enters the error callback. Verify that you received the expected status and that there are no outstanding requests.
  4. httpResource derives a request from signals. Changing the shelf value cancels the previous request and starts a new request for the current shelf.
  5. Every endpoint in these exercises is intercepted locally. Progress event support depends on the transport and the transfer.

Sources