Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to pass basic auth for api in angular 11

import { HttpHeaders } from '@angular/common/http';

const httpOptions = {
  headers: new HttpHeaders({
    'Content-Type':  'application/json',
    'Authorization': 'Basic ' + btoa('username:password')
  })
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pass #basic #auth #api #angular
ADD COMMENT
Topic
Name
4+1 =