infId =-1 upload_url ='' params ={'openId':OpenId,'apiKey':ApiKey,'fileName':'test_input.png'} session = requests.session() ret = requests.post(f"{ApiUrl}/api/inf/inf_upload", data=json.dumps(params)) res =0if ret.status_code==200:if'data'in ret.json():print(ret.json()) data = ret.json()['data'] infId = data['infId'] upload_url = data['uploadUrl']""" [Success] An example returns the result {'code': 200, 'msg': 'ok', 'data': {'infId': 3609, 'uploadUrl': 'xxx'}} """ print("current infId is: ", data['infId'], " Be sure to remember this id! Otherwise, the task cannot be queried")
print("The image upload link is: ", data['uploadUrl'])else:""" 【fail】 {'code': 500, 'msg': 'You have 0.0 coins, but try-on need 5'} """print(ret.json()) data = ret.json()print("info is, ", data)exit(0)