python API 触发jenkinsjob

url = "http://2xxxxxx:8020/job/ParentPomCheck/buildWithParameters"
payload={'GitUrl': gitUrl, 'Branch': branch}
files=[]

按照 username:password 格式 使用 base64加密得到 x密码x

headers = {'Authorization': 'Basic x密码x'}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)

你可能感兴趣的:(python API 触发jenkinsjob)