I’m trying to make an HTTP request from a Ionic app to to ocr.space API.
this is the code I wrote, the base64image comes from the Camera plugin and is correctly formatted:
let base64Image = 'data:image/jpeg;base64,' + imageData;
let data = "base64Image=" + base64Image;
this.http.post("https://api.ocr.space/parse/image",data,{
headers: new HttpHeaders().set('Content-Type','application/x-www-form-urlencoded')
.set('apikey',this.APIKEY),
})
.subscribe((res)=> console.log(res))
However the response I’m getting is that the format of the image is not correct (not true). What am I doing wrong? Thanks for the help!