标签:ons 执行 str response protocol oid exce post basic
如下代码段是关于Android下通过HttpClient执行 HTTP POST 请求 的代码。try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("id", "12345"));
nameValuePairs.add(new BasicNameValuePair("stringdata", "AndDev is Cool!"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
} catch (ClientProtocolException e) {
} catch (IOException e) {
}
}
Android下通过HttpClient执行 HTTP POST 请求 的代码
标签:ons 执行 str response protocol oid exce post basic
原文地址:http://blog.51cto.com/14137088/2331713