Basic Auth with Jenkins http-request-plugin

前端 未结 2 880
死守一世寂寞
死守一世寂寞 2021-01-04 11:02

I am trying to make a simple POST-request with the \"Http Request Plugin\". My problem is with getting the credentials to work. I have set a global credential, user:p

相关标签:
2条回答
  • 2021-01-04 11:17

    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:

    0 讨论(0)
  • 2021-01-04 11:26

    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.

    0 讨论(0)
提交回复
热议问题