Going from com.sun.jersey.api.client.Client to javax.ws.rs.client.Client how do I configure Client?
FROM:
import com.su
I assume you are using jax-rs-ri. For this, you can use ClientProperties.CONNECT_TIMEOUT and ClientProperties.READ_TIMEOUT.
Example:
ClientConfig configuration = new ClientConfig();
configuration = configuration.property(ClientProperties.CONNECT_TIMEOUT, 1000);
configuration = configuration.property(ClientProperties.READ_TIMEOUT, 1000);
Client client = ClientBuilder.newClient(configuration);
WebTarget target = client.target(
"http://developer.github.com/v3/");
String content = target.request().get(String.class);
System.out.println(content);
EDIT:
I read the API document for ClientConfig.property. And @Gili is right.