Difference Between Http & HttpClient
Najim Pathan
AWS Cloud || Node Js. || Python || React JS|| Angular || MEAN || MERN Stack Developer || Freelancer
Http:
- Http Iintroduce in Angular 2.0
- Http used tho make Rest API Call
- Http Depends on rxjs Package
- In Http ,Debugging is Difficult
- Writing unit test cases is Dificult
- Performance is poor Compare to HtttpClient
- Implementing Http Application is Dificult
- We Must Convert Rest API Result Into json formate
- may not run in all operating system(os dependent)
- No Specific class to Categorized the error
HttpClient
- HttpClien introduce in Angular 4
- HttpClient used to make Rest API Call
- It Won't Depend on rxjs package
- Debugging is Easy
- Writing unit test cases is easy
- Performance is High Compare to Http
- Implimenting HttpClient Application Is Easy
- HttpClient Automatically Converts the Rest API Result into the json formate
- We will execute in All Operating Systems
- HttpErrorResponse is used to categorized the error
-HttpErrorResponse is the predefined class in Angular
HttpErrorResponse class introduced in Angular 4.3