泽西客户授权

时间:2018-12-11 14:11:04

标签: java rest curl jersey go-cd

我正在尝试将此curl命令转换为球衣请求:

curl host:8154/go/api/pipelines/build_service/schedule -u 'username:password'

我快到了,但是我不断收到401未经授权。这是我的客户

this.client = ClientBuilder.newBuilder()
                .register(userAuth(username, password))
                .withConfig(config)
                .hostnameVerifier(new TrustAllHostNameVerifier())
                .sslContext(new Ssl().getSslContext())
                .build();

这是userAuth

private HttpAuthenticationFeature userAuth(String username, String password) {
    return HttpAuthenticationFeature.basic(username, password);
}

-u选项不是基本授权吗?

0 个答案:

没有答案