Http auth post req to api wordpress


#1

function in api provider :

doLogin(username, password){
         this.body = {
            username: username,
            password: password
        };
        return this.http.post(this.API_LOGIN +'token',this.body);
    }

login.ts :

onLogin(){
    this.api.doLogin(this.username,this.password).subscribe((res)=>{
      console.log(res)
    });
}

And Here error image : https://ibb.co/mxV9Sy

thanks