/** * Gets content type of response * * @param response request response * @return content type */ protected static ContentType getContentType(HttpResponse response) { return ContentType.getOrDefault(response.getEntity()); }
/** * Gets string body of response * * @param response request response * @return response body * @throws IOException */ protected static String getResponseBody(HttpResponse response) throws IOException { HttpEntity entity = response.getEntity(); return entity == null ? null : EntityUtils.toString(entity); }