HTTP request using Jenkins Pipeline Job

I am trying to execute an HTTP request in a Jenkins Pipeline Job using the HTTPRequest plugin

script{def response = httpRequest authentication: 'CredentialsID',  url: "https://host/api/project-summary/kj/?kj=123"}

I created credentials with the ID "CredentialID" in Jenkins.

I get the following error when creating a task - enter image description here

I already mentioned this question about StackOverflow, but that didn't help.

Can anyone point out an error in this or is there some other approach that I can use to make an HTTP request from the Jenkins Pipeline Job?

UPDATE: I also created credentials with the id - "CredentialsID" in jenkins, as shown below: enter image description here

0
source share

Source: https://habr.com/ru/post/1666382/


All Articles