回覆列表
  • 1 # 使用者7063786766555

    HttpClient client = new HttpClient();

    PostMethod post = new PostMethod("your url");

    //準備引數,可以是多個

    NameValuePair simcard = new NameValuePair("key","value");

    post.setRequestBody(new NameValuePair[]{simcard});

    //執行請求

    client.executeMethod(method);

    //獲取返回值

    String response = new String(method.getResponseBodyAsString().getBytes("iso-8859-1"));

    //把json字串轉換為物件,有很多方法

    SONObject result = new JSONObject(response);

  • 中秋節和大豐收的關聯?
  • 孕婦在懷孕幾個月是補鈣的最佳時期?