开发者

How to use HttpClient using Post method?

How to开发者_开发知识库 use HttpClient using Post method ?


See a docs on DefaultHttpClient class and HttpPost class

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();


here you can get an good example Executing a HTTP POST Request with HttpClient

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜