1.参数格式:
2.注意事项:
如果是webservice的地址,请求地址后面不可以加?wsdl
3.调用方法:
HttpPost httpRequest = new HttpPost(url);
httpRequest.setHeader("Content-Type", "text/plain");
httpRequest.setEntity(new StringEntity(参数,"UTF-8"));
/** 保持会话Session end **/
HttpResponse response = httpClient.execute(httpRequest);
HttpEntity entity = response.getEntity();//
if (response.getStatusLine().getStatusCode() == HttpURLConnection.HTTP_OK) {
String result = EntityUtils.toString(response.getEntity());
return result;
}
if (entity != null) {
entity.consumeContent();
}