Basic Auth with Jenkins http-request-plugin

北战南征 提交于 2019-11-30 20:19:34

HTTP Request Plugin v1.8.18 now supports credentials in the Credentials Plugin (the HTTP Request Plugin v1.8.18 now depends on v2.1.3 of the Credentials Plugin).

To perform an HTTP request using a Jenkins credential you can use the following code:

def response = httpRequest authentication: 'credentialsID', url: "http://www.example.com"

where credentialsID is the ID of the credentials in Jenkins:

The basic credentials under Configure System > HTTP Request now states that the Basic/Digest Authentication is deprecated and to use Jenkins credentials instead:

The Credentials for the Http Request Plugin are not managed by the Credentials Plugin but rather under Configure System -> HTTP Request like shown in the picture.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!