I'm looking to understand how to incorporate the httpClient interceptor in this brief example, leveraging Angular5.
import { Observable } from 'rxjs/Observable';
import {HttpClient, HttpHeaders} from '@angular/common/http';
//service
logintest(): Observable<any>{
var body = {
"username": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3b5a59587b5a595815585456">[email protected]</a>",
"password": "Passw0rd",
}
let headers = new HttpHeaders().set('Content-Type','application/x-www-form-urlencoded; charset=utf-8;');
return this.http.post("http://restapiUrl/v1/loginservice", body, {headers: headers});
}
Appreciate your help on this matter. Best regards, Andrea.