TSP Python 用例
import requests
import json
# 设置API端点
url = 'https://tspapi.jzlog.cn/process'
# 读取并发送JSON文件
with open('tsp_example.json', 'r') as file:
json_data = json.load(file)
response = requests.post(url, json=json_data)
# 处理响应
if response.status_code == 200:
response_data = response.json()
print("提交成功,返回数据:", response_data)
else:
print(f"提交失败,状态码:{response.status_code}")
下载示例JSON文件
TSP 文档
VRP Python 用例
import requests
import json
# 设置API端点
url = 'https://vrpapi.jzlog.cn/process'
# 读取并发送JSON文件
with open('vrp_example.json', 'r') as file:
json_data = json.load(file)
response = requests.post(url, json=json_data)
# 处理响应
if response.status_code == 200:
response_data = response.json()
print("提交成功,返回数据:", response_data)
else:
print(f"提交失败,状态码:{response.status_code}")
下载示例JSON文件
VRP 文档