Blog/backend/req_test.py

15 lines
391 B
Python
Raw Permalink Normal View History

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