This commit is contained in:
looly
2021-12-09 16:48:47 +08:00
parent 2dae6e54c0
commit bdef4713e2
3 changed files with 124 additions and 85 deletions

View File

@@ -20,6 +20,8 @@ import java.util.Map;
* <pre>
* key1=v1&amp;key2=&amp;key3=v3
* </pre>
* 查询封装分为解析查询字符串和构建查询字符串解析可通过charset为null来自定义是否decode编码后的内容<br>
* 构建则通过charset是否为null是否encode参数键值对
*
* @author looly
* @since 5.3.1

View File

@@ -130,4 +130,11 @@ public class UrlQueryTest {
final String a = UrlQuery.of(MapUtil.of("a ", " ")).build(CharsetUtil.CHARSET_UTF_8);
Assert.assertEquals("a%20=%20", a);
}
@Test
public void parsePercentTest(){
String queryStr = "a%2B=ccc";
final UrlQuery query = UrlQuery.of(queryStr, null);
Assert.assertEquals(queryStr, query.toString());
}
}