本文整理了Java中com.gargoylesoftware.htmlunit.WebClient.removeRequestHeader()
方法的一些代码示例,展示了WebClient.removeRequestHeader()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.removeRequestHeader()
方法的具体详情如下:
包路径:com.gargoylesoftware.htmlunit.WebClient
类名称:WebClient
方法名:removeRequestHeader
[英]Removes a header from being sent with EVERY request from this client.
[中]从此客户端的每个请求中删除发送的标头。
代码示例来源:origin: out0fmemory/GuozhongCrawler
public void clearHeaders(){
WebClient webClient = getWebClient();
for (String name:headerNames) {
webClient.removeRequestHeader(name);
}
headerNames.clear();
}
代码示例来源:origin: com.thoughtworks.inproctester/jerseytester-webdriver
@Override
public void get(String url) {
getWebClient().addRequestHeader(HttpHeaders.ACCEPT, MediaType.TEXT_HTML);
super.get(url);
getWebClient().removeRequestHeader(HttpHeaders.ACCEPT);
}
代码示例来源:origin: USCDataScience/sparkler
String userAgent = getUserAgent();
if (StringUtils.isNotBlank(userAgent)) {
driver.removeRequestHeader(USER_AGENT);
driver.addRequestHeader(USER_AGENT, userAgent);
内容来源于网络,如有侵权,请联系作者删除!