如何使用Post方法使用HttpClient?
答案 0 :(得分:3)
查看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();
答案 1 :(得分:2)
在这里你可以得到一个很好的例子Executing a HTTP POST Request with HttpClient