3laba/http_requests.py

9 lines
332 B
Python

import requests
# Отправляем GET-запрос
response = requests.get("http://vyatsu.ru")
# Выводим статус код и первые 500 символов ответа
print(f"Status Code: {response.status_code}")
print(f"Headers: {response.headers}")
print(f"Content (first 500 chars):\n{response.text[:500]}")