I'm trying to send data with http post following differents threads, but I can't do it. I need to send this data, tested in postman.
Headers. Content-Type: application/x-www-form-urlencoded Authorization: Basic user:pass
Body. grant_type: password scope: profile
This is my code.
login() {
let url = URL_LOGIN;
let headers = new Headers(
{
'Content-Type': 'application/json',
'Authorization': 'Basic user:pass'
});
let body = {
'grant_type': 'password',
'scope': 'profile'
}
return this.http.post(url, body, { headers: headers })
.map((response: Response) => {
var result = response.json();
return result;
})
}
Thanks in advance!!