title: Angular SyntaxError JSON.parse: unexpected character
body: <p>im making a http get request to and specific url and the response is a string (base64 images) using this method:</p>
  
  <pre><code>  public getSingleImage(imgId): Promise&lt;any&gt; {
      return new Promise((resolve, reject) =&gt; {
        const url = `${CONST.DOCUMENT_SINGLE_IMAGE}/${imgId}` + '/base64';
        this.http.get(url)
          .toPromise()
          .then((res: any) =&gt; {
            // value = res;
            resolve(res);
          }).catch((error) =&gt; {
            console.log(error);
          });
      });
    }
  </code></pre>
  
  <p>for some reason i getting the error <code>JSON.parse: unexpected character at line 1 column 1 of the JSON data</code></p>
  
  <p>Here is the response header:</p>
  
  <pre><code>Access-Control-Allow-Credentials: true
  Access-Control-Allow-Origin: http://localhost:4200
  api-supported-versions: 1.0
  Content-Type: text/plain; charset=utf-8
  Date: Wed, 14 Mar 2018 14:01:07 GMT
  Server: Kestrel
  Transfer-Encoding: chunked
  Vary: Origin
  </code></pre>