相关疑难解决方法(0)

使用Jenkins http-request-plugin进行基本身份验证

我试图用"Http Request Plugin"做一个简单的POST请求.我的问题是让凭据工作.我已经设置了全球凭证 user:pass.

但是在我的代码中尝试这个

withCredentials([usernameColonPassword(credentialsId: 'akamai', variable: 'akamai')]) {

    def response = httpRequest url: requestUrl, contentType: requestContentType, httpMode: requestHttpMode, requestBody: requestContent, authentication: akamai
    echo "Status: ${response.status}\nContent: ${response.content}"
}
Run Code Online (Sandbox Code Playgroud)

结果是

java.lang.IllegalStateException: Authentication 'user:pass' doesn't exist anymore
Run Code Online (Sandbox Code Playgroud)

groovy jenkins-plugins jenkins-pipeline

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

groovy ×1

jenkins-pipeline ×1

jenkins-plugins ×1