if (ClientResponse.class.equals(type)) {
return (T)this;
}
ProvidersRegistry providersRegistry = getAttribute(ProvidersRegistry.class);
RuntimeContext saved = RuntimeContextTLS.getRuntimeContext();
ClientRuntimeContext runtimeContext = new ClientRuntimeContext(providersRegistry);
RuntimeContextTLS.setRuntimeContext(runtimeContext);
try {
String contentType = getHeaders().getFirst(HttpHeaders.CONTENT_TYPE);
if (contentType == null || contentType.length() == 0) {
contentType = MediaType.APPLICATION_OCTET_STREAM;