{"error": "unsupported_grant_type"} Angular

0

How about, I have the following code in angular to try to access the API of BMSKaseya, in postman I run it perfectly with the same parameters and Headers, but in angular I get the error {"error": "unsupported_grant_type"} Can you help me?

accesToken(){
let url = "https://bms.kaseya.com/api/token"
let headers = new HttpHeaders();
headers.append('Accept','application/json');
headers.append('Content-Type','application/x-www-form-urlencoded');

let params = new HttpParams();
params.append('grant_type', '#')
params.append('username', '#')
params.append('password', '#')
params.append('tenant', '#')


return this.http.post(url, {headers}, {params}).map(res=>{
   console.log(res)
})
    
asked by Angel Mora 06.02.2018 в 21:53
source

0 answers