private String connServerForResult(String url) {
String strResult = "";
try {
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost();
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
httpPost.setURI(new URI(url));
//httpPost,通过urlParam添加请求参数
List < NameValuePair > urlParam = new ArrayList < NameValuePair > ();
//中文内容,通过URLDecoder.decode转码
urlParam.add(new BasicNameValuePair("date", URLDecoder.decode(date_search.getText().toString(), "utf-8")));
httpPost.setEntity(new UrlEncodedFormEntity(urlParam, HTTP.UTF_8));
HttpResponse response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
if (entity != null)
strResult = EntityUtils.toString(entity, HTTP.UTF_8);
} catch (Exception e) {
//
}
return strResult;
}