how to pass basic auth for api in angular 11

Solutions on MaxInterview for how to pass basic auth for api in angular 11 by the best coders in the world

showing results for - "how to pass basic auth for api in angular 11"
Ali
30 Aug 2019
1import { HttpHeaders } from '@angular/common/http';
2
3const httpOptions = {
4  headers: new HttpHeaders({
5    'Content-Type':  'application/json',
6    'Authorization': 'Basic ' + btoa('username:password')
7  })
8};
9