-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAICheckIsolaterREjpg.py
39 lines (38 loc) · 1.37 KB
/
AICheckIsolaterREjpg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'''
*******************************************************************************
函数名称: AICheckIsolaterREjpg
描 述:算法服务在检测完成后推送至应用服务器信息
此处为模拟返回时算法服务的post操作,直接运行即可,注意修改host参数
作 者:lxh
编写时间:2023.1.3
*******************************************************************************/
'''
import json
import requests
host = "http://192.168.3.8:5000/" # 部署的服务器地址,根据main.py中的服务地址而改变
login_url = "/AICheckIsolaterREjpg" # 请求地址
url = host + login_url # 拼接地址
with open('serverTestment/base64_incode_opened.json', 'rb') as p:
params = json.load(p) # 加载json文件
source = params["A-result-pic"]
# 参数
body = {
{
"operator": " AICheckIsolaterREjpg",
" IsolaterInfo": {
" issueNumber ": "221228-51411-1",
"IsolaterID": "51411",
"IsolaterName": "I 间隔隔离刀闸",
"IsolaterCmd": "1"
},
"picinfo": {
"APicInfo": "data:image/jpeg;base64,"+ source,
"BPicInfo": "data:image/jpeg;base64,"+ source,
"CPicInfo": "data:image/jpeg;base64,"+ source
}
}
}
# 发送请求
r = requests.post(url=url, json=body)
# 输出返回
print(r.text)