fix comment and add method

This commit is contained in:
Looly 2020-12-15 17:17:54 +08:00
parent 8dd004f4ee
commit ec9eee4aed
2 changed files with 12 additions and 1 deletions

View File

@ -1008,6 +1008,17 @@ public class HttpRequest extends HttpBase<HttpRequest> {
return proxyAuth(HttpUtil.buildBasicAuth(username, password, charset)); return proxyAuth(HttpUtil.buildBasicAuth(username, password, charset));
} }
/**
* 令牌验证生成的头类似于"Authorization: Bearer XXXXX"一般用于JWT
*
* @param token 令牌内容
* @return HttpRequest
* @since 5.5.3
*/
public HttpRequest bearerAuth(String token) {
return auth("Bearer " + token);
}
/** /**
* 验证简单插入Authorization头 * 验证简单插入Authorization头
* *

View File

@ -74,7 +74,7 @@ final class InternalJSONUtil {
* 缩进使用空格符 * 缩进使用空格符
* *
* @param writer writer * @param writer writer
* @param indent 进空格数 * @param indent 进空格数
* @throws IOException IO异常 * @throws IOException IO异常
*/ */
protected static void indent(Writer writer, int indent) throws IOException { protected static void indent(Writer writer, int indent) throws IOException {