我有以下课程:
public class GetHtmlContent {
public static String GetHtml(){
String content = null;
URLConnection connection = null;
try {
connection = new URL("https://www.tomshardware.com/").openConnection();
Scanner scanner = new Scanner(connection.getInputStream());
scanner.useDelimiter("\\Z");
content = scanner.next();
}catch ( Exception ex ) {
ex.printStackTrace();
}
return content;
}
}
我该怎么做才能让每个请求都被视为NEW,就像我在 Chrome 的隐身模式下一样
注意:该站点只是一个示例