客户端 主要代码
HttpPost httpRequest = new HttpPost(urlAPI);
List <NameValuePair> params = new ArrayList <NameValuePair>();
String x=et1.getText().toString();
String x1=et2.getText().toString();
params.add(new BasicNameValuePair("str",URLEncoder.encode(x)));
params.add(new BasicNameValuePair("str1",URLEncoder.encode(x1)));
try
{
/*发叨HTTP request*/
httpRequest.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
/*取得HTTP res......
阅读全文