Retrieve Response body as plain text or xml in Angularjs 2 HTTP GET request
<p>I am trying to make <code>get</code> request to server which returns XML:</p>

<pre><code>let text = "";
this.http.get('http://example.com', {headers : headers})
     .map((res:Response) =&gt; res.text()).subscribe(data =&gt; text = data);
</code></pre>

<p>But, <code>text</code> variable is empty string, how can I retrieve plain text to convert to XML or how can I directly get XML?</p>