接口上传图片方法
host = re_data_yaml.get_host() h = re_data_yaml.get_headers() url = host + '/api/update_face_photo' files = {"file": ('aaa.jpg', open("F:\\aaa.jpg", 'rb'), "image/jpg")} # 上传图片 r = requests.post(url, files=files, headers=h) result = r.json() img_photo = re.findall(r"http(.+?)cn", r.json()["data"]["img_photo"]) # 正则提取数据