ClientRequestFactory RestEasy Deprecated… Any other RestEasy alternative ?

一世执手 提交于 2019-12-04 18:09:33
lefloh

Resteasy Client-API has been marked deprecated as JAX-RS standardized a Client-API. You can find information about the Resteasy-integration of the new Client-API in the documentation.

Your example could look like (untested):

Client client = ClientBuilder.newClient();
Response response = client.target("http://url-of-service").request().get();
// read and close the response

Or if you want to use Resteasy Proxy Framework:

Client client = ClientFactory.newClient();
ResteasyWebTarget target = (ResteasyWebTarget) client.target("http://url-of-service");
SomeRestInterface client = target.proxy(SomeRestInterface.class);
client.theMethod();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!