import requests import json r=requests.post('http://127.0.0.1:7788',data=open('5.jpg','rb')) code=json.loads(r.text)['code'] print(code)