Curl
curl -X POST \https://api.pix.com/v3/latex
-H 'app_id: trial' \
-H 'app_key: 34f1a4cea0eaca8540c95908b4dc84ab' \
-H 'Content-Type: application/json' \
--data '{ "url": "data:image/jpeg;base64,'$(base64 -i limit.jpg)'" }'
Python
#!/usr/bin/env python
import sys
import base64
import requests
import json
# put desired file path here
file_path = 'limit.jpg'
image_uri = "data:image/jpg;base64," + base64.b64encode(open(file_path, "rb").read())
r = requests.post("https://api.pix.com/v3/latex",
data=json.dumps({'url': image_uri}),
headers={"app_id": "trial", "app_key": "34f1a4cea0eaca8540c95908b4dc84ab",
"Content-type": "application/json"})
print json.dumps(json.loads(r.text), indent=4, sort_keys=True)
How to make it work in Ionic?