add GlobalInterceptor

This commit is contained in:
Looly
2022-03-28 01:14:03 +08:00
parent 63ad6de20d
commit 6427d6fb13
6 changed files with 75 additions and 6 deletions

View File

@@ -167,4 +167,17 @@ public class HttpRequestTest {
execute = HttpRequest.get(url).setMaxRedirectCount(1).execute();
Console.log(execute.getStatus(), execute.header(Header.LOCATION));
}
@Test
@Ignore
public void addInterceptorTest() {
HttpUtil.createGet("https://hutool.cn").addInterceptor(Console::log).execute();
}
@Test
@Ignore
public void addGlobalInterceptorTest() {
GlobalInterceptor.INSTANCE.addInterceptor(Console::log);
HttpUtil.createGet("https://hutool.cn").execute();
}
}