I haven't tried anything all i have is http post method, i need to pass the username and password as base authentication to every API i am hitting
onSubmit = function(userdata){
     this.tokenkey = localStorage.getItem('logintoken');
  console.log(JSON.stringify(userdata));
this.pass=
{
  "foodid": userdata.foodid,
  "foodname": userdata.foodname,
  "state" : userdata.state,
  "station" : userdata.station,
  "district" : userdata.district,
  "zipcode" : userdata.zipcode,
  "country" : userdata.country,
  "description" : userdata.description,
}
 this.http.post(SERVER_URL+'fooddata/add',this.pass).subscribe((Response) => {
   console.log(Response);
 if(Response.ok === true){
    this.Success();
    this.temp = {};
    this.userdata.reset();
  }
 else this.Error();
})
}
Any help on how to pass authentication header in this API ?
 
    