コード例 #1
0
  @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;
  }
コード例 #2
0
  @Override
  protected String doInBackground(String... urls) {

    String json = HttpServer.getInstance().get(urls[0]);
    return json;
  }