add brotli support

This commit is contained in:
Looly
2022-10-24 17:18:18 +08:00
parent 51e4a14388
commit 79e7e51727
6 changed files with 104 additions and 28 deletions

View File

@@ -0,0 +1,20 @@
package cn.hutool.http;
import cn.hutool.core.lang.Console;
import org.brotli.dec.BrotliInputStream;
import org.junit.Ignore;
import org.junit.Test;
public class IssueI5XBCFTest {
@Test
@Ignore
public void getTest() {
GlobalCompressStreamRegister.INSTANCE.register("br", BrotliInputStream.class);
final HttpResponse s = HttpUtil.createGet("https://static-exp1.licdn.com/sc/h/br/1cp0oqz322bdprj3qd4pojqix")
.header(Header.ACCEPT_ENCODING, "br")
.execute();
Console.log(s.body());
}
}