update
This commit is contained in:
10
test.py
10
test.py
@@ -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)
|
||||
Reference in New Issue
Block a user