This commit is contained in:
hackrobot
2024-07-18 09:38:18 +08:00
parent 4ef917c9f1
commit 993efda0a6
2 changed files with 12 additions and 2 deletions

10
test.py
View File

@@ -2,9 +2,17 @@ import requests
# url = "http://127.0.0.1:8000/send_message"
url = "http://192.168.31.38:8521/send_message"
# url = "http://tg.yidooplanet.com/send_message"
data = {"message": "Hello, World!"}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=data, headers=headers)
print(response.json())
try:
response_data = response.json()
print(response_data)
except requests.exceptions.JSONDecodeError:
print("Response content is not in JSON format")
print("Response content:", response.text)