void (@NotNull Logger logger, @NotNull HttpMethod response) { if (logger.isDebugEnabled() && response.hasBeenUsed()) { try { String content = TaskResponseUtil.getResponseContentAsString(response); org.apache.commons.httpclient.Header header = response.getRequestHeader(HTTP.CONTENT_TYPE); String contentType = header == null ? "text/plain" : StringUtil.toLowerCase(header.getElements()[0].getName()); if (contentType.contains("xml")) { TaskUtil.prettyFormatXmlToLog(logger, content); } else if (contentType.contains("json")) { TaskUtil.prettyFormatJsonToLog(logger, content); } else { logger.debug(content); } } catch (IOException e) { logger.error(e); } } }