ClashTray/main/test1.py
2023-12-23 22:45:32 +08:00

15 lines
No EOL
420 B
Python

import requests
url = "http://127.0.0.1:9090/"
data = {"mode": "rule"}
response=requests.get(url=url+'configs')
print(response.status_code)
print(response.json())
response1=requests.patch(url=url+'configs?force=true',json=data)
# global
# response = requests.patch(url+'configs', json=data)
# direct
print(response1.status_code)
print(response1.text) # 如果服务器返回 JSON 数据的话
print(response.json())