JAX-RS 中 ClientFactory 和 ClientBuilder 的区别

Difference between ClientFactory and ClientBuilder in JAX-RS

使用创建新的 Client 实例有什么区别 JAX-RS 中的 ClientFactoryClientBuilder

客户端 API 中不存在 ClientFactory class,在 JAX-RS 2.0 中引入。看看 javax.ws.rs.client 包。

ClientFactory class 出现在 JAX-RS 2.0 规范的候选版本和里程碑中,但已被 ClientBuilder class. For more details, you can check the old versions of the javax.ws.rs-api 工件取代。

创建Client instances, use ClientBuilder

Client client = ClientBuilder.newClient();