add old lci module
This commit is contained in:
1 parent
38a6e815f0
commit
8499631091
171 files changed
+25562
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import requests
|
||||
import json
|
||||
|
||||
def test_create_process():
|
||||
"""测试访问phs web服务的create接口"""
|
||||
# 设置请求URL
|
||||
url = "http://localhost:5200/api/v2/create"
|
||||
|
||||
# 设置请求数据
|
||||
data = ["timeout", "/t", "1000"]
|
||||
|
||||
# 发送POST请求
|
||||
response = requests.post(url, data=json.dumps(data))
|
||||
|
||||
# 打印响应状态码
|
||||
print(f"响应状态码: {response.status_code}")
|
||||
|
||||
# 尝试解析响应内容为JSON格式并打印
|
||||
try:
|
||||
response_json = response.json()
|
||||
print(f"响应内容: {json.dumps(response_json, indent=2, ensure_ascii=False)}")
|
||||
except json.JSONDecodeError:
|
||||
print(f"响应内容(非JSON格式): {response.text}")
|
||||
|
||||
# 返回响应对象供进一步处理
|
||||
return response
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 执行测试函数
|
||||
test_create_process()
|
||||
Reference in new issue
Block a user