protected < T > T readResponse ( Response response , JavaType javaType ) { try { return objectMapper . readValue ( response . body ( ) . byteStream ( ) , javaType ) ; } catch ( IOException e ) { throw new ClientMarshallingException ( "Error reading results." , e ) ; } }
Read the response and unmarshall into the expected type