Package | Description |
---|---|
cn.hutool.core.codec |
BaseN以及BCD编码封装
|
cn.hutool.core.net |
网络相关工具
|
cn.hutool.core.net.url |
URL相关工具
|
Modifier and Type | Method and Description |
---|---|
PercentCodec |
PercentCodec.addSafe(char c)
增加安全字符
安全字符不被编码 |
static PercentCodec |
PercentCodec.of(CharSequence chars)
创建PercentCodec,使用指定字符串中的字符作为安全字符
|
static PercentCodec |
PercentCodec.of(PercentCodec codec)
从已知PercentCodec创建PercentCodec,会复制给定PercentCodec的安全字符
|
PercentCodec |
PercentCodec.or(PercentCodec codec)
增加安全字符到挡墙的PercentCodec
|
PercentCodec |
PercentCodec.orNew(PercentCodec codec)
组合当前PercentCodec和指定PercentCodec为一个新的PercentCodec,安全字符为并集
|
PercentCodec |
PercentCodec.removeSafe(char c)
移除安全字符
安全字符不被编码 |
PercentCodec |
PercentCodec.setEncodeSpaceAsPlus(boolean encodeSpaceAsPlus)
是否将空格编码为+
如果为 true ,则将空格编码为"+",此项只在"application/x-www-form-urlencoded"中使用如果为 false ,则空格编码为"%20",此项一般用于URL的Query部分(RFC3986规范) |
Modifier and Type | Method and Description |
---|---|
static PercentCodec |
PercentCodec.of(PercentCodec codec)
从已知PercentCodec创建PercentCodec,会复制给定PercentCodec的安全字符
|
PercentCodec |
PercentCodec.or(PercentCodec codec)
增加安全字符到挡墙的PercentCodec
|
PercentCodec |
PercentCodec.orNew(PercentCodec codec)
组合当前PercentCodec和指定PercentCodec为一个新的PercentCodec,安全字符为并集
|
Modifier and Type | Field and Description |
---|---|
static PercentCodec |
FormUrlencoded.ALL
query中的value,默认除"-", "_", "
|
static PercentCodec |
RFC3986.FRAGMENT
fragment = pchar / "/" / "?"
|
static PercentCodec |
RFC3986.GEN_DELIMS
gen-delims = ":" / "/" / "?"
|
static PercentCodec |
RFC3986.PATH
path = segment / "/"
|
static PercentCodec |
RFC3986.PCHAR
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
static PercentCodec |
RFC3986.QUERY
query = pchar / "/" / "?"
|
static PercentCodec |
RFC3986.QUERY_PARAM_NAME
query中的key
key不能包含" & " 和 "=" |
static PercentCodec |
RFC3986.QUERY_PARAM_NAME_STRICT
query中的key编码器,严格模式,key中不能包含任何分隔符。
|
static PercentCodec |
RFC3986.QUERY_PARAM_VALUE
query中的value
value不能包含" & ",可以包含 "=" |
static PercentCodec |
RFC3986.QUERY_PARAM_VALUE_STRICT
query中的value编码器,严格模式,value中不能包含任何分隔符。
|
static PercentCodec |
RFC3986.RESERVED
reserved = gen-delims / sub-delims
see:https://www.ietf.org/rfc/rfc3986.html#section-2.2 |
static PercentCodec |
RFC3986.SEGMENT
segment = pchar
see: https://www.ietf.org/rfc/rfc3986.html#section-3.3 |
static PercentCodec |
RFC3986.SEGMENT_NZ_NC
segment-nz-nc = SEGMENT ; non-zero-length segment without any colon ":"
|
static PercentCodec |
RFC3986.SUB_DELIMS
sub-delims = "!"
|
static PercentCodec |
RFC3986.UNRESERVED
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
see: https://www.ietf.org/rfc/rfc3986.html#section-2.3 |
Modifier and Type | Method and Description |
---|---|
String |
UrlQuery.build(PercentCodec keyCoder,
PercentCodec valueCoder,
Charset charset)
构建URL查询字符串,即将key-value键值对转换为
key1=v1&key2=v2&key3=v3 形式。 |
String |
UrlQuery.build(PercentCodec keyCoder,
PercentCodec valueCoder,
Charset charset,
boolean encodePercent)
构建URL查询字符串,即将key-value键值对转换为
key1=v1&key2=v2&key3=v3 形式。 |
Copyright © 2024. All rights reserved.