fix url encode bug

This commit is contained in:
Looly
2021-05-09 00:44:19 +08:00
parent d8eebe1879
commit 3f233bae81
7 changed files with 162 additions and 43 deletions

View File

@@ -1,5 +1,6 @@
package cn.hutool.http;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.CharsetUtil;
@@ -325,4 +326,11 @@ public class HttpUtilTest {
final String s = HttpUtil.get("http://hq.sinajs.cn/list=sh600519");
Console.log(s);
}
@Test
@Ignore
public void gimg2Test(){
byte[] bytes = HttpUtil.downloadBytes("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic.jj20.com%2Fup%2Fallimg%2F1114%2F0H320120Z3%2F200H3120Z3-6-1200.jpg&refer=http%3A%2F%2Fpic.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1621996490&t=8c384c2823ea453da15a1b9cd5183eea");
Console.log(Base64.encode(bytes));
}
}