@SuppressWarnings("unchecked") @Override protected String doInBackground(String... urls) { HttpServer httpServer = HttpServer.getInstance(); String json = null; if (entity instanceof JSONObject) { json = httpServer.post(urls[0], (JSONObject) entity); } else if (entity instanceof List) { json = httpServer.post(urls[0], (List<NameValuePair>) entity); } else { throw new RuntimeException("Unsupported object : " + entity.getClass()); } return json; }
@Override protected String doInBackground(String... urls) { String json = HttpServer.getInstance().get(urls[0]); return json; }