0
這是否有什麼區別?在編寫Web服務方法時,URL方式適用於我,但實體方式返回了一些錯誤。這兩個都一樣嗎?HttpPost - 作爲名稱值對的參數中的參數與參數
HttpPost httpPost = new HttpPost("http://example.com/sampleservice?params=paramOne");
VS
HttpPost httpPost = new HttpPost("http://example.com/sampleservice");
List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>();
nameValuePair.add(new BasicNameValuePair("params",
"ParamOne"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePair));