Blog/backend/req_test.py

15 lines
391 B
Python
Raw Normal View History

2024-01-16 11:42:01 +00:00
import requests
# Отправляем GET запрос на сервер
2024-01-17 18:20:18 +00:00
response = requests.get(
2024-01-18 21:37:48 +00:00
'http://localhost:2281',
2024-01-17 18:20:18 +00:00
params={
"command_type": "get",
2024-01-18 21:37:48 +00:00
"method": "getPost",
2024-01-17 18:20:18 +00:00
"command_id": "8",
"contract": "post",
2024-01-18 21:37:48 +00:00
"args": ["post_1"]})
2024-01-16 11:42:01 +00:00
# Выводим ответ от сервера
print('Ответ от сервера:', response.text)