欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

HttpClient用法  

程序员文章站 2022-07-12 20:34:56
...
apache Httpcomponents下载地址:http://hc.apache.org/downloads.cgi

HttpClient client = new DefaultHttpClient();
     HttpGet httpGet = new HttpGet(richURL);
     HttpResponse res = client.execute(httpGet);//请求并获得响应
     String strResult=EntityUtils.toString(res.getEntity());