How can get HttpClient Status Code in Angular 4

Solution 1:

From this section, this is the adjusted code

http
  .post<T>('/yoururl', whateverYourPostRequestIs, {observe: 'response'})
  .subscribe(resp => {
     console.log(resp);
  });

the answer is {observe: 'response'}. you can then view the logged resp and pick/choose what you want.