jenkins抛出java.lang.IllegalArgumentException:当我尝试绕过SSL错误时,预期的命名参数

时间:2019-02-18 12:32:18

标签: jenkins groovy jenkins-pipeline

我正在尝试使用以下Jenkins Pipeline DSL方法并使用ignoreSslErrors: true来忽略SSL错误来获取ELB的响应代码:

def elbResponse = httpRequest url:  "https://my-elb-url.com", ignoreSslErrors: true

但是,当我建立工作时,出现以下错误;

java.lang.IllegalArgumentException: Expected named arguments but got [{ignoreSslErrors=true}, https://my-elb-url.com
]

我试图绕过SSL错误的方式在语法上有问题吗?

1 个答案:

答案 0 :(得分:1)

ReferenceError: post is not defined
at app.post (/home/equalsignlearning/redis_op/app.js:104:10)
at Layer.handle [as handle_request] (/home/equalsignlearning/redis_op/node_modules/express/lib/router/layer.js:95:5)
at next (/home/equalsignlearning/redis_op/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/equalsignlearning/redis_op/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/equalsignlearning/redis_op/node_modules/express/lib/router/layer.js:95:5)
at /home/equalsignlearning/redis_op/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/home/equalsignlearning/redis_op/node_modules/express/lib/router/index.js:335:12)
at next (/home/equalsignlearning/redis_op/node_modules/express/lib/router/index.js:275:10)
at jsonParser (/home/equalsignlearning/redis_op/node_modules/body-parser/lib/types/json.js:101:7)
at Layer.handle [as handle_request] (/home/equalsignlearning/redis_op/node_modules/express/lib/router/layer.js:95:5)

您似乎缺少括号。

此外,如果“获取”(GET),请指定httpMode,默认为POST。

https://jenkins.io/doc/pipeline/steps/http_request/#httprequest-perform-an-http-request-and-return-a-response-object