String response = method.getResponseBodyAsString(100);
logger.debug("status: " + statusCode + " response: " + response);
if (statusCode != HttpStatus.SC_CREATED && statusCode != HttpStatus.SC_OK) {
throw new Exception("Http post failed");
}
method.releaseConnection();
ok = true;
} finally {
if (!ok) {
method.abort();
}