2zadaniepraktiki/gitea_read.py
2026-04-12 18:18:18 +03:00

17 lines
311 B
Python

import requests
import os
TOKEN = os.getenv("GITEA_TOKEN")
if not TOKEN:
print("Токен не найден")
exit()
headers = {
"Authorization": f"token {TOKEN}"
}
response = requests.get("https://git.vyatsu.ru/api/v1/user", headers=headers)
print(response.status_code)
print(response.json())