import base64 import requests url = 'http://192.168.199.249:2991' # url = 'http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm' # header = { # 'Authorization': 'Bearer 9679c2b3-b90b-4029-a3c7-f347b4d242f7' # } def send_request(image_path): with open(image_path, 'rb') as f: img_str: str = base64.encodebytes(f.read()).decode('utf-8') r = requests.post(f'{url}/ocr_system/bankcard', json={'image': img_str}) print(r.json()) return r.json()