Я пытаюсь войти в локальный веб-сервис, используя xml:
Вот код:
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'text/xml',
'Accept': 'text/xml',
'Response-Type': 'text'
})
};
login() {
const postedData = `
<authenticationDetail>
<userName>myusername</userName>
<password>mypassword</password>
</authenticationDetail>`;
return this.http.post('http://localhost/login.ws', postedData, httpOptions)
.subscribe(
result => {
console.log('This result is' + result);
},
error => {
console.log('There was an error: ', error);
}
);
}
Я получаю ошибку:
Http failure during parsing for 'http://localhost/login.ws'
В чем здесь проблема? Как я могу это исправить?