1import { HttpClient, HttpHeaders } from '@angular/common/http';
2
3...
4constructor(private http: HttpClient){}
5...
6const httpOptions = {
7 headers: new HttpHeaders({
8 'Content-Type': 'application/json',
9 'Authorization': environment.key
10 })
11 };
12 this.http.post(environment.APIUrl, httpOptions).subscribe(
13 response => {
14 console.log(response);
15 });
16...