在通过curl来直接构建jenkins的时候,使用一下命令:
curl -X POST http://127.0.0.1:8080/job/test/build?delay=0sec
结果返回:403 no valid crumb was included in the request 这样的错误提示
解决方法,使用如下命令:
curl -H 7a027c44-c69f-44ea-bcb4-564313a3c4c1 http://127.0.0.1:8080/job/test/build?delay=0sec
其中crumb的值(7a027c44-c69f-44ea-bcb4-564313a3c4c1)可在jenkins用户管理页面查看
参考地址:http://stackoverflow.com/questions/28577551/how-to-disable-a-jenkins-job-via-curl
