public class HttpAuthUtil extends Object
Constructor and Description |
---|
HttpAuthUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
buildBasicAuth(PasswordAuthentication authentication,
Charset charset)
构建简单的账号秘密验证信息,构建后类似于:
Basic YWxhZGRpbjpvcGVuc2VzYW1l
|
static String |
buildBasicAuth(String username,
String password,
Charset charset)
构建简单的账号秘密验证信息,构建后类似于:
Basic YWxhZGRpbjpvcGVuc2VzYW1l
|
public static String buildBasicAuth(PasswordAuthentication authentication, Charset charset)
Basic YWxhZGRpbjpvcGVuc2VzYW1l
authentication
- PasswordAuthentication
charset
- 编码(如果账号或密码中有非ASCII字符适用)Copyright © 2025. All rights reserved.