mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add GlobalInterceptor
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user