Products
GG网络技术分享 2025-11-13 02:19 1
基于您给的文档片段,
token 或 crumb 参数以通过 CSRF 校验。token 参数用于 CSRF 校验, crumb 参数同样用于 CSRF 校验,需要在 headers 中携带嗯。/api/json 返回任务列表时 其后来啊是 JSON 格式;获取配置信息时返回 XML 格式。
python import requests
url = "http://localhost:/createItem?name=testjob"
headers = {"Content-Type": "application/xml"}
body = """
response = requests.post
url = "http://localhost:/job/testjob/build" parameters = {"token": "mytoken"} response = requests.post
url = "http://localhost:/api/json" response = requests.get jsondata = response.json jobs = jsondata
for job in jobs: print)
通过遵循以上觉得Neng和示例,您Nenggeng有效地用 Jenkins API 进行开发干活。
Demand feedback