Here is my code:
import { HttpClient, HttpErrorResponse, HttpHeaders } from \'@angular/common/http\';
I was with Angular 8 and the only thing which worked for me was this:
getCustomHeaders(): HttpHeaders { const headers = new HttpHeaders() .set('Content-Type', 'application/json') .set('Api-Key', 'xxx'); return headers; }