Android的HttpClient的 - 越来越与preemptive认证文件 [英] Android httpclient - getting a file with preemptive authentication

查看:163
本文介绍了Android的HttpClient的 - 越来越与preemptive认证文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这个例子code得到一个网站的HTML code的问题。

I have problems getting the HTML code of a website by using this example code.

<一个href="http://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x/httpclient/src/examples/org/apache/http/examples/client/Client$p$pemptiveBasicAuthentication.java">http://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x/httpclient/src/examples/org/apache/http/examples/client/Client$p$pemptiveBasicAuthentication.java

我不得不使用上述之一,因为我需要为我的Andr​​oid应用程序preemptive认证。

I have to use the above one, as I need preemptive authentication for my application in Android.

我以为解决办法可能是HTTPGET对象,但我仍然只得到错误:( C.F. HTTPGET HTTPGET =新HTTPGET(/ index.html的);

I thought the solution might be the httpget object, but I still get only errors :( c.f. HttpGet httpget = new HttpGet("/index.html");

没有任何人有一个想法如何获取文件,该文件使用上面的链接的例子code指定的HTTPGET对象的内容。它绝对称得上,但现在我只能拿到状态code等...

Does anybody have an idea how to get the content of the file, which is specified in the httpget object above using the example code of the link. It definitely called, but for now I can only get status code and so on ...

感谢4的帮助

推荐答案

在我过去一年解决,我放弃了HttpClient的本土pre先发制人的HTTP认证和公正的推出的首部自己

When I tackled this last year, I gave up on HttpClient's native pre-emptive HTTP authentication and just rolled the header myself.

这篇关于Android的HttpClient的 - 越来越与preemptive认证文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆