im making a http get request to and specific url and the response is a string (base64 images) using this method:
public getSingleImage(imgId): Promise<any> {
return new Promise((resolve, reject) => {
const url = `${CONST.DOCUMENT_SINGLE_IMAGE}/${imgId}` + '/base64';
this.http.get(url)
.toPromise()
.then((res: any) => {
// value = res;
resolve(res);
}).catch((error) => {
console.log(error);
});
});
}
for some reason i getting the error JSON.parse: unexpected character at line 1 column 1 of the JSON data
Here is the response header:
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