add HttpConfig

This commit is contained in:
Looly
2022-03-31 20:47:47 +08:00
parent 6a79844dec
commit c3cdbf5bb5
7 changed files with 467 additions and 107 deletions

View File

@@ -171,13 +171,16 @@ public class HttpRequestTest {
@Test
@Ignore
public void addInterceptorTest() {
HttpUtil.createGet("https://hutool.cn").addInterceptor(Console::log).execute();
HttpUtil.createGet("https://hutool.cn")
.addInterceptor(Console::log)
.addResponseInterceptor((res)-> Console.log(res.getStatus()))
.execute();
}
@Test
@Ignore
public void addGlobalInterceptorTest() {
GlobalInterceptor.INSTANCE.addInterceptor(Console::log);
GlobalInterceptor.INSTANCE.addRequestInterceptor(Console::log);
HttpUtil.createGet("https://hutool.cn").execute();
}