Given the resource class:
iamge:19.png
Choose the fragment that a client could use to request “/res/value” using its JSON representation (Choose one):
A.
WebResource resource = client.resource(“/res/value”); Value val =
resource.accept(“application/json”).get(Value.class);
B.
WebResource resource = client.resource(“/res/value”); Value val =
resource.type(“application/json”).get(Value.class);
C.
WebResource resource = client.resource(“/res”);
Value val =
resource.accept(“value”).type(“application/json”).get(Value.class);
D.
WebResource resource = client.resource(“/res/value”); Value val = resource.get(Value.class);
Acceptable media type is set to Accept header via accept() method. OTOH type() sets the Content-type header. Since Jersey 2.x bring s a new JAX-RS 2.0 client API,
WebResource.Builder accept(MediaType… types) Add acceptable media types.
http://www.javased.com/?api=com.sun.jersey.api.client.WebResource