ClientResponse clientResponse = httpLowLevel.postFileRaw(scanUri, MediaType.APPLICATION_OCTET_STREAM_TYPE, MediaType.TEXT_PLAIN_TYPE, file);
//Funny issue with service, currently only returns MediaType.TEXT_PLAIN_TYPE, but the
//response needs to be processed as JSON. So, wrap the return in a ClientResponse that acts
//as if the content type is JSON. There is a bug on the core server side to fix this.
InBoundHeaders headers = new InBoundHeaders();
headers.putSingle("Content-Type", MediaType.APPLICATION_JSON);
return new ClientResponse(clientResponse.getStatus(), headers, clientResponse.getEntityInputStream(), clientResponse.getClient().getMessageBodyWorkers());
} finally {
is.close();
}