title: Angular 5 - HttpClient XML Post - Http failure during parsing
body: <p>I am trying to login on a local webservice using xml:</p>
  
  <p>Here is the code:</p>
  
  <pre><code>const httpOptions = {
    headers: new HttpHeaders({
      'Content-Type':  'text/xml',
      'Accept':  'text/xml',
      'Response-Type': 'text'
    })
  };
  
  
  login() {
      const postedData = `
          &lt;authenticationDetail&gt;
              &lt;userName&gt;myusername&lt;/userName&gt;
              &lt;password&gt;mypassword&lt;/password&gt;
          &lt;/authenticationDetail&gt;`;
      return this.http.post('http://localhost/login.ws', postedData, httpOptions)
      .subscribe(
          result =&gt; {
              console.log('This result is' + result);
          },
          error =&gt; {
              console.log('There was an error: ', error);
          }
      );
  }
  </code></pre>
  
  <p>The error I'm getting is:</p>
  
  <pre><code>Http failure during parsing for 'http://localhost/login.ws'
  </code></pre>
  
  <p>What is the problem here? How can I fix this?</p>