DigesterRepresentation digester = new DigesterRepresentation(rep);
// Such representation computes the digest while
// consuming the wrapped representation.
digester.exhaust();
// Set the digest with the computed one
digester.setDigest(digester.computeDigest());
request.setEntity(digester);
Response response = client.handle(request);
assertEquals(Status.SUCCESS_OK, response.getStatus());