A match against the old standard

The new HttpClient was introduced in July 2017 as an improved version of the former Angular HTTP client API, also known as @angular/http, or simply HTTP. Instead of replacing the old version in the @angular/http package, the Angular development team has put the new classes in a separate package--@angular/common/http. They chose to do that to preserve the backward-compatibility with the existing code bases and also to ensure a slow, yet steady migration to the new API.

Those who used the old Angular HTTP service class at least once will most likely remember its main limitations:

  • JSON was not enabled by default, forcing the developers to explicitly set it within the request Headers--and JSON.parse/stringify ...

Get ASP.NET Core 2 and Angular 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.