if (username != null && username.length() > 0) {
String password = config.getPassword();
client.removeFilter(null);
client.addFilter(new HTTPBasicAuthFilter(username, password));
}
client.addFilter(new LoggingFilter(LOGGER));
WebResource webResource = client.resource(config.getApiUrl());
Markdown markdown = new Markdown(mdText);
ClientResponse response = webResource.path("markdown").type(MediaType.APPLICATION_JSON).entity(markdown).accept(MediaType.TEXT_HTML)
.post(ClientResponse.class);