My problem is that I get this error when using httpClient from angular:
ERROR DOMException: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL
at https://localhost:xxxx/polyfills.js:5749:31
Code for http request in angular:
return this.httpClient.post<any>(host + '/isam/oidc/endpoint/amapp-runtime-oidcidp/token', body, {
headers: new HttpHeaders().set('Content-type', 'application/x-www-form-urlencoded')
});
But if I am using fetch is working:
fetch(host + '/isam/oidc/endpoint/amapp-runtime-oidcidp/token', {
method: 'POST',
credentials: 'include',
body: 'xxxxxx',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
}
})
.then(res => { res.json(); console.log(res); })
.then(myJson => { console.log(myJson) })
I am doing everything from localhost for now. If you can help me please to find what I am doing wrong with httprequest.
Thank you