import requests base_url = 'http://git.deploy.in.ixiaochuan.cn' token = '49b60357fc0a65639f8030c69128241d6c5cb487' # 获取所有仓库 def get_all_repos(): url = base_url + f'/api/v1/user/repos?token={token}' headers = { "Content-Type": "application/json", } response = requests.get(url, headers=headers) res = response.json() projects = [] for i in res: projects.append(i.get('id')) return projects def update_repo(): url = base_url + f'/api/v1/user/repos{token}' response = requests.post(url) print(response.text) if __name__ == '__main__': repo = "project/zy-recoff-recpool" get_all_repos()