如何使用Post方法使用HttpClient?
答
查看DefaultHttpClient类和HttpPost类
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://your.site/your/service");
// set some headers if needed
post.addHeader(....);
// and an eclosed entity to send
post.setEntity(....);
// send a request and get response (if needed)
InputStream responseStream = client.execute(post).getEntity().getContent();
先生,我实现这个代码,但它表明我没有什么产出。我想加入这个“http://www.antikvarlden.se/antikguiden-json.aspx” – 2011-03-24 06:36:46
你是如何得到输出的?你在服务器端检查吗? – Olegas 2011-03-24 06:46:29