mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix URL
This commit is contained in:
@@ -11,6 +11,10 @@ public class SimpleServerTest {
|
||||
HttpUtil.createServer(8888)
|
||||
// 设置默认根目录,
|
||||
.setRoot("d:/test")
|
||||
// get数据测试,返回请求的PATH
|
||||
.addAction("/get", (request, response) ->
|
||||
response.write(request.getURI().toString(), ContentType.TEXT_PLAIN.toString())
|
||||
)
|
||||
// 返回JSON数据测试
|
||||
.addAction("/restTest", (request, response) ->
|
||||
response.write("{\"id\": 1, \"msg\": \"OK\"}", ContentType.JSON.toString())
|
||||
|
@@ -295,4 +295,13 @@ public class HttpUtilTest {
|
||||
String mimeType = HttpUtil.getMimeType("aaa.aaa");
|
||||
Assert.assertNull(mimeType);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void getWeixinTest(){
|
||||
// 测试特殊URL,即URL中有&情况是否请求正常
|
||||
String url = "https://mp.weixin.qq.com/s?__biz=MzI5NjkyNTIxMg==&mid=100000465&idx=1&sn=1044c0d19723f74f04f4c1da34eefa35&chksm=6cbda3a25bca2ab4516410db6ce6e125badaac2f8c5548ea6e18eab6dc3c5422cb8cbe1095f7";
|
||||
final String s = HttpUtil.get(url);
|
||||
Console.log(s);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user