ANIL
ANIL

Reputation: 2682

jenkins throws java.lang.IllegalArgumentException: Expected named arguments when I try to bypass SSL errors

I am trying to fetch the response code for my ELB using the following Jenkins Pipeline DSL method and using ignoreSslErrors: true to ignore the SSL error:

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

However, when I build my job I get the following error;

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

Is there something syntactically wrong with the way I am trying to bypass the SSL errors?

Upvotes: 1

Views: 2135

Answers (1)

user9105725
user9105725

Reputation:

def elbResponse = httpRequest (url: ‘https://my-elb-url.com’, ignoreSslErrors: true, httpMode: ‘GET’)

You appear to be missing the parenthesis.

Also, if “fetching” (GET), specify that httpMode, as the default is POST.

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

Upvotes: 1

Related Questions