我正在尝试将此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
选项不是基本授权吗?