diff --git a/create_repo.py b/create_repo.py new file mode 100644 index 0000000..b2c9cad --- /dev/null +++ b/create_repo.py @@ -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())