我正在使用 RESTEasy(JAX-RS 的实现)。我找不到为 ClientRequest 设置基本、抢占式身份验证的方法。
ClientRequest request = new ClientRequest("<url>");
// -- here I want to add basic-preemptive authentication --
ClientResponse response = request.get();
System.out.println(response.getEntity(String.class));
正确的方法是什么?还有其他方法吗?
谢谢你。