Gitea lab3
This commit is contained in:
1 parent
08d33e1080
commit
52e50ad7f7
1 file changed
+20
@@ -0,0 +1,20 @@
|
|||||||
|
import requests
|
||||||
|
import os
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
load_dotenv() # ← ЭТОГО У ТЕБЯ НЕТ
|
||||||
|
|
||||||
|
TOKEN = os.getenv("TOKEN")
|
||||||
|
|
||||||
|
print("TOKEN =", TOKEN) # для проверки
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"Authorization": f"token {TOKEN}"
|
||||||
|
}
|
||||||
|
|
||||||
|
response = requests.get(
|
||||||
|
"https://git.vyatsu.ru/api/v1/user",
|
||||||
|
headers=headers
|
||||||
|
)
|
||||||
|
|
||||||
|
print(response.json())
|
||||||
Reference in new issue
Block a user