本文整理了Java中com.gargoylesoftware.htmlunit.WebClient.makeWebResponseForAboutUrl()
方法的一些代码示例,展示了WebClient.makeWebResponseForAboutUrl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.makeWebResponseForAboutUrl()
方法的具体详情如下:
包路径:com.gargoylesoftware.htmlunit.WebClient
类名称:WebClient
方法名:makeWebResponseForAboutUrl
暂无
代码示例来源:origin: net.sourceforge.htmlunit/htmlunit
/**
* Loads a {@link WebResponse} from the server.
* @param webRequest the request
* @throws IOException if an IO problem occurs
* @return the WebResponse
*/
public WebResponse loadWebResponse(final WebRequest webRequest) throws IOException {
switch (webRequest.getUrl().getProtocol()) {
case "about":
return makeWebResponseForAboutUrl(webRequest.getUrl());
case "file":
return makeWebResponseForFileUrl(webRequest);
case "data":
return makeWebResponseForDataUrl(webRequest);
default:
return loadWebResponseFromWebConnection(webRequest, ALLOWED_REDIRECTIONS_SAME_URL);
}
}
代码示例来源:origin: HtmlUnit/htmlunit
/**
* Loads a {@link WebResponse} from the server.
* @param webRequest the request
* @throws IOException if an IO problem occurs
* @return the WebResponse
*/
public WebResponse loadWebResponse(final WebRequest webRequest) throws IOException {
switch (webRequest.getUrl().getProtocol()) {
case "about":
return makeWebResponseForAboutUrl(webRequest.getUrl());
case "file":
return makeWebResponseForFileUrl(webRequest);
case "data":
return makeWebResponseForDataUrl(webRequest);
default:
return loadWebResponseFromWebConnection(webRequest, ALLOWED_REDIRECTIONS_SAME_URL);
}
}
代码示例来源:origin: org.jvnet.hudson/htmlunit
/**
* Loads a {@link WebResponse} from the server.
* @param webRequestSettings settings to use when making the request
* @throws IOException if an IO problem occurs
* @return the WebResponse
*/
public WebResponse loadWebResponse(final WebRequestSettings webRequestSettings)
throws IOException {
final WebResponse response;
final String protocol = webRequestSettings.getUrl().getProtocol();
if (protocol.equals("about")) {
response = makeWebResponseForAboutUrl(webRequestSettings.getUrl());
}
else if (protocol.equals("file")) {
response = makeWebResponseForFileUrl(webRequestSettings.getUrl(), webRequestSettings.getCharset());
}
else if (protocol.equals("data")) {
if (browserVersion_.isFirefox()) {
response = makeWebResponseForDataUrl(webRequestSettings);
}
else {
throw new MalformedURLException("Unknown protocol: data");
}
}
else {
response = loadWebResponseFromWebConnection(webRequestSettings, ALLOWED_REDIRECTIONS_SAME_URL);
}
return response;
}
代码示例来源:origin: org.jenkins-ci/htmlunit
/**
* Loads a {@link WebResponse} from the server.
* @param webRequestSettings settings to use when making the request
* @throws IOException if an IO problem occurs
* @return the WebResponse
*/
public WebResponse loadWebResponse(final WebRequestSettings webRequestSettings)
throws IOException {
final WebResponse response;
final String protocol = webRequestSettings.getUrl().getProtocol();
if (protocol.equals("about")) {
response = makeWebResponseForAboutUrl(webRequestSettings.getUrl());
}
else if (protocol.equals("file")) {
response = makeWebResponseForFileUrl(webRequestSettings.getUrl(), webRequestSettings.getCharset());
}
else if (protocol.equals("data")) {
if (browserVersion_.isFirefox()) {
response = makeWebResponseForDataUrl(webRequestSettings);
}
else {
throw new MalformedURLException("Unknown protocol: data");
}
}
else {
response = loadWebResponseFromWebConnection(webRequestSettings, ALLOWED_REDIRECTIONS_SAME_URL);
}
return response;
}
代码示例来源:origin: net.disy.htmlunit/htmlunit
/**
* Loads a {@link WebResponse} from the server.
* @param webRequestSettings settings to use when making the request
* @throws IOException if an IO problem occurs
* @return the WebResponse
*/
public WebResponse loadWebResponse(final WebRequestSettings webRequestSettings)
throws IOException {
final WebResponse response;
final String protocol = webRequestSettings.getUrl().getProtocol();
if (protocol.equals("about")) {
response = makeWebResponseForAboutUrl(webRequestSettings.getUrl());
}
else if (protocol.equals("file")) {
response = makeWebResponseForFileUrl(webRequestSettings.getUrl(), webRequestSettings.getCharset());
}
else if (protocol.equals("data")) {
if (browserVersion_.isFirefox()) {
response = makeWebResponseForDataUrl(webRequestSettings);
}
else {
throw new MalformedURLException("Unknown protocol: data");
}
}
else {
response = loadWebResponseFromWebConnection(webRequestSettings, ALLOWED_REDIRECTIONS_SAME_URL);
}
return response;
}
内容来源于网络,如有侵权,请联系作者删除!