Ajout du script de creation de depot via API
parent
c59d1390a5
commit
ac12d691a9
@ -0,0 +1,21 @@
|
|||||||
|
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())
|
||||||
Loading…
Reference in New Issue