从com.sun.jersey.api.client.Client到javax.ws.rs.client.Client如何配置客户端?
从:
import com.sun.jersey.api.client.Client;
Client client = Client.create();
client.setReadTimeout(1000 * 60 * 20);
client.setConnectTimeout(1000 * 20);
webResource = client.resource("someWhereOverTheRainbow");
..etc.
至:
import javax.ws.rs.client.*;
Client client = ClientBuilder.newClient();
// **now what?** client.getConfiguration().getProperties().put("isThisTheWayToDoIt", 1000 * 60 * 2);
WebTarget target = client.target("someWhereOverTheRainbow");
..etc.