title: Why httpclient in angular 4 is assuming that request am sending json data
body: <p>I am using angular 4 http client to a server which returns text data so for that I did something like below </p>
  
  <pre><code>this.http.get('assets/a.txt').map((res:Response) =&gt; 
  res.text()).subscribe((data: any) =&gt; {
    console.log(data.text());
  });
  </code></pre>
  
  <p>I did not tell it any where that the response is in json format but still it is raising the below error</p>
  
  <blockquote>
    <p>SyntaxError: Unexpected token a in JSON at position 0 at Object.parse
    () at XMLHttpRequest.onLoad</p>
  </blockquote>
  
  <p>On what basis these people assume as the response is in json format :)</p>