gpt4 book ai didi

Android httpclient - 获取具有抢先身份验证的文件

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:06:03 25 4
gpt4 key购买 nike

我在使用此示例代码获取网站的 HTML 代码时遇到问题。

http://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java

我必须使用上面的那个,因为我需要在 Android 中为我的应用程序进行抢占式身份验证。

我认为解决方案可能是 httpget 对象,但我仍然只收到错误 :(比较HttpGet httpget = new HttpGet("/index.html");

有没有人知道如何使用链接的示例代码获取文件的内容,这是在上面的 httpget 对象中指定的。它确实调用了,但是现在我只能获取状态代码等等......

感谢4位帮助

最佳答案

当我去年解决这个问题时,我放弃了 HttpClient 的 native 抢先式 HTTP 身份验证,而只是 rolled the header myself .

关于Android httpclient - 获取具有抢先身份验证的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2960425/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com