15 lines
No EOL
420 B
Python
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()) |