This commit is contained in:
Looly
2022-09-30 18:11:20 +08:00
parent 0189434df8
commit 6bde21ff4a

View File

@@ -1,19 +1,17 @@
package cn.hutool.http; package cn.hutool.http;
import cn.hutool.core.lang.Console; import cn.hutool.core.lang.Console;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import java.net.HttpCookie;
public class IssueI5TPSYTest { public class IssueI5TPSYTest {
@Test @Test
@Ignore //@Ignore
public void redirectTest() { public void redirectTest() {
final String url = "https://bsxt.gdzwfw.gov.cn/UnifiedReporting/auth/newIndex"; final String url = "https://bsxt.gdzwfw.gov.cn/UnifiedReporting/auth/newIndex";
final HttpResponse res = HttpUtil.createGet(url).setFollowRedirects(true) final HttpResponse res = HttpUtil.createGet(url).setFollowRedirects(true)
.cookie(new HttpCookie("iPlanetDirectoryPro", "123")) .header(Header.USER_AGENT, "PostmanRuntime/7.29.2")
.cookie("jsessionid=s%3ANq6YTcIHQWrHkEqOSxiQNijDMhoFNV4_.h2MVD1CkW7sOZ60OSnPs7m4K%2FhENfYy%2FdzjKvSiZF4E")
.execute(); .execute();
Console.log(res.body()); Console.log(res.body());
} }