android - 如何在android中进行HTTP身份验证?

标签 android http-authentication

我正在检查类 org.apache.http.auth。 如果有人有更多的引用或例子吗?

最佳答案

对我来说,它有效,

final String basicAuth = "Basic " + Base64.encodeToString("user:password".getBytes(), Base64.NO_WRAP);

Apache HttpCLient:

request.setHeader("Authorization", basicAuth);

HttpUrlConnection:

connection.setRequestProperty ("Authorization", basicAuth);

关于android - 如何在android中进行HTTP身份验证?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1968416/

相关文章:

java - 将 Android 应用程序从 Android Studio 移植到 Microsoft Visual Studio

android - 如何在动态表格布局中显示分页?

Android 复选框对话框(简单)

ruby - 使用 Ruby 向 Azure 进行身份验证(HTTP header 身份验证)?

http - Apache2 mod_proxy 认证

android - 使用 Apportable 向 Android Manifest 添加权限

android - 如何以编程方式更改形状纯色?

javascript - 使用nodejs的请求模块进行http认证返回未定义的主体

php - Wowza 服务器上的 PHP 脚本的 HTTP 身份验证失败?

apache - 强制通过 HTTPS 进行 HTTP 身份验证