DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
httppost.setHeader("Content-Type", "application/json");
StringEntity entity;
try {
entity = new StringEntity(JsonUtil.object2json(parameters), "UTF-8");
httppost.setEntity(entity);
} catch(UnsupportedEncodingException e) {
logger.error("", e);
}
try {
HttpResponse httpResponse = httpclient.execute(httppost);
HttpEntity resEntity = httpResponse.getEntity();
if(null != resEntity) {
result = IOUtils.toString(resEntity.getContent(), "utf-8");
}
} catch(ClientProtocolException e) {
logger.error(e);
} catch(IOException e) {
logger.error(e);
} finally {
httpclient.getConnectionManager().shutdown();
}