Why do I need the json jersey dependencies on client side for
service.path("rest").path("object").path(id).accept(MediaType.APPLICATION_JSON).get(ObjectDTO.class);
but not for
service.path("rest").path("object").path(id).accept(MediaType.APPLICATION_JSON).put(ClientResponse.class, object);
Server side looks like this:
@GET
@Path("/{objectId}")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
...
@PUT
@Path("/{objectId}")
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
...
In first case I get a json stream, in second case I send a stream. So why do I need the libraries just for getting the stream?
Ok. It is caused by the accept header: for my put request it isnt necessary to set that.