gpt4 book ai didi

java - selenium 中 ApacheHttpClient 类的替代方案是什么

转载 作者:太空宇宙 更新时间:2023-11-04 09:11:15 25 4
gpt4 key购买 nike

我的代码如下

RemoteWebDriver driver = new RemoteWebDriver(new HttpCommandExecutor(new HashMap<String, CommandInfo>(),
new URL(URL), new Factory() {
private HttpClientBuilder builder;
{
builder = HttpClientBuilder.create();
HttpHost proxy = new HttpHost(proxy,proxyport);
System.out.println(proxy);
builder.setProxy(proxy);
System.out.println(builder);

}

@Override
public HttpClient createClient(URL url) {
return new ApacheHttpClient(builder.build(), url);
}

但是由于 ApacheHttpClient 类已被弃用,在上面的代码中使用 ApacheHttpClient 类的替代方案是什么

最佳答案

您可以使用 HttpClient 代替 ApacheHttpClient

关于java - selenium 中 ApacheHttpClient 类的替代方案是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59644577/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com