Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230578

Call mathpix api in ionic

$
0
0

this.images=[

      './assets/img/ekva.jpg']
   }

ionViewDidLoad(){
  let headers = new Headers();
       headers.append('Content-Type', 'application/json');
       headers.append('app-id', 'trial');
       headers.append('app_key', '34f1a4cea0eaca8540c95908b4dc84ab');



  let data={"url":"data:image/jpg;base64,"+this.images};

       this.http.post('https://api.mathpix.com/v3/latex', JSON.stringify(data), {headers: headers})
         .subscribe(res => {
                 console.log("success");
         }, (err) => {
           console.log("failed");
         });

console.log(JSON.stringify(data))
}

How base64 the image and upload it to api and get back the response in latex.

I get error corupted data

{error: "Corrupted data! Please retry.", latex: "", latex_list: [], latex_confidence: 0}
error
:
"Corrupted data! Please retry."
latex
:
""
latex_confidence
:
0
latex_list
:
[]

Viewing all articles
Browse latest Browse all 230578

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>