.header(REMOTE_USER, user).accept(accept)
.type(mimeType).method(httpMethod, ClientResponse.class,
(isPost(httpMethod) ? incomingRequest.getInputStream() : null));
incomingRequest.getInputStream().reset();
Family status = response.getClientResponseStatus().getFamily();
if (status == Family.INFORMATIONAL || status == Family.SUCCESSFUL) {
return (T) response.getEntity(method.getReturnType());
} else if (response.getClientResponseStatus().getStatusCode() ==
Response.Status.BAD_REQUEST.getStatusCode()) {
LOG.error("Request failed: " + response.getClientResponseStatus().getStatusCode());