private String spejdPost(JsonObject jo) { @SuppressWarnings({"resource"}) DefaultHttpClient httpclient = new DefaultHttpClient(); HttpResponse resp; HttpPost httpPost = new HttpPost(SPEJD_SERVICE_POST); httpPost.addHeader("Content-Type", "application/json"); StringEntity reqEntity = null; try { reqEntity = new StringEntity(jo.toString()); } catch (UnsupportedEncodingException e) { System.out.println(e.toString()); } assert reqEntity != null; httpPost.setEntity(reqEntity); try { resp = httpclient.execute(httpPost); return EntityUtils.toString(resp.getEntity()); } catch (IOException e) { e.printStackTrace(); } return null; }