示例#1
0
 /**
  * Gets content type of response
  *
  * @param response request response
  * @return content type
  */
 protected static ContentType getContentType(HttpResponse response) {
   return ContentType.getOrDefault(response.getEntity());
 }
示例#2
0
 /**
  * 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);
 }