This commit is contained in:
Looly
2024-12-03 13:02:20 +08:00
parent 4aa6f799b2
commit eebb94c636
6 changed files with 48 additions and 29 deletions

View File

@@ -19,6 +19,7 @@ package org.dromara.hutool.http.client;
import org.dromara.hutool.core.io.StreamProgress;
import org.dromara.hutool.core.io.file.FileUtil;
import org.dromara.hutool.core.lang.Console;
import org.dromara.hutool.core.map.MapUtil;
import org.dromara.hutool.http.HttpGlobalConfig;
import org.dromara.hutool.http.client.engine.ClientEngineFactory;
import org.junit.jupiter.api.Assertions;
@@ -50,6 +51,13 @@ public class DownloadTest {
Console.log("Download size: " + size);
}
@Test
void downloadWithHeaderTest() {
HttpDownloader.of("https://hutool.cn/")
.header(MapUtil.of("Authorization", "token"))
.downloadFile(FileUtil.file("d:/test/"));
}
@Test
@Disabled
public void downloadTest() {