You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
460 B
Python
22 lines
460 B
Python
|
1 day ago
|
import requests
|
||
|
|
|
||
|
|
TOKEN = "TON_TOKEN_API"
|
||
|
|
URL = "https://forge.gwenaelremond.fr/api/v1/user/repos"
|
||
|
|
|
||
|
|
headers = {
|
||
|
|
"Authorization": f"token {TOKEN}",
|
||
|
|
"Content-Type": "application/json",
|
||
|
|
"accept": "application/json"
|
||
|
|
}
|
||
|
|
|
||
|
|
data = {
|
||
|
|
"name": "exercice",
|
||
|
|
"description": "Mon depot exercice API",
|
||
|
|
"auto_init": True,
|
||
|
|
"private": False
|
||
|
|
}
|
||
|
|
|
||
|
|
response = requests.post(URL, headers=headers, json=data)
|
||
|
|
print(response.status_code)
|
||
|
|
print(response.json())
|