android - AndroidHttpClient 中的 HttpRequestInterceptor。我糊涂了!

标签 android http

我在我的应用程序中使用 AndroidHttpClient。现在我需要对请求使用基本授权。

http://developer.android.com/reference/android/net/http/AndroidHttpClient.html

在文档中,他们说我可以使用 HttpRequestInterceptor,但我不知道我该怎么做。没有添加此拦截器的方法。理想情况下,我想像他们在这里那样添加它: http://dlinsin.blogspot.com/2009/08/http-basic-authentication-with-android.html

有人知道为什么它对我不起作用或 Google 文档有误吗?

最佳答案

好吧,这是不可能的,显然文档是错误的。必须使用普通的 HttpClient 才能让它工作。

关于android - AndroidHttpClient 中的 HttpRequestInterceptor。我糊涂了!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5839075/

相关文章:

安卓:xml 还是 json?

android - 在 Android 应用程序之间共享数据

android - 果冻 bean android的自定义通知布局

android - UTF-8 的 MultipartEntityBuilder 和 setCharset 发送空内容

python - 使用部分下载 (HTTP) 下载文件

java - 下载多个 JSON 数组 Android

Android - 使用过多的线性布局

http - 如何知道使用什么端口从 Postman 发出 http Get 请求

ruby - 在 ruby​​ 中使用 Net::HTTP 代理通过代理访问网站

c - 基于 libmicrohttpd 的服务器,具有带外身份验证