HttpClient.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:glvideoplayer-android 作者:
private void init(String ua) {
    client = new DefaultHttpClient();

    client.setRedirectHandler(new DefaultRedirectHandler() {
        public URI getLocationURI(HttpResponse res, HttpContext arg1) throws ProtocolException {
            URI uri = super.getLocationURI(res, arg1);
            if (res.getFirstHeader("Location") != null) {
                location = uri.toString();// res.getFirstHeader("Location").getValue();
            }
            return uri;
        }
    });
    client.getParams().setParameter("http.useragent", ua);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号