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);
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);