让我们一起爱米兰
站内搜搜:
移动设备
请扫描二维码
或访问
m.milan100.com
您所在的位置 -> 米兰百分百 -> android相关 -> android用HttpClient 进行http get请求

android用HttpClient 进行http get请求

点击数:1432 发表时间:2010-11-25 08:37:53 作者: 来源链接:
分享到:
分享到微信

// 创建HttpClient 实例



final HttpClient client = new DefaultHttpClient();     

// execute a GET-request and get the response as a String


final String response =    Http.get(\"http://somesite.com\")   
        .use(client)                // 用HttpClient实例来进行请求(required)

 

        .charset(\"UTF-8\")           // 进行编码(optional)

        .followRedirects(true)      // 设置允许跳转(optional)

 

        .asString();                // 进行请求



 

0
很 好
0
一 般
0
差 劲
热门新闻
相关文章
上一篇: WebView:激活JavaScript和打开内部链接
下一篇: adb工具的使用
评论区
匿名

返回首页 | 收藏本页 | 回到顶部
Copyright 2010. 米兰百分百 Powered By Bridge.
京ICP备15050557号