MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / getWebRequest

Method getWebRequest

src/main/java/org/htmlunit/html/HtmlLink.java:249–260  ·  view source on GitHub ↗

Returns the request which will allow us to retrieve the content referenced by the href attribute. @return the request which will allow us to retrieve the content referenced by the href attribute @throws MalformedURLException in case of problem resolving the URL

()

Source from the content-addressed store, hash-verified

247 * @throws MalformedURLException in case of problem resolving the URL
248 */
249 public WebRequest getWebRequest() throws MalformedURLException {
250 final HtmlPage page = (HtmlPage) getPage();
251 final URL url = page.getFullyQualifiedUrl(getHrefAttribute());
252
253 final BrowserVersion browser = page.getWebClient().getBrowserVersion();
254 final WebRequest request = new WebRequest(url, browser.getCssAcceptHeader(), browser.getAcceptEncodingHeader());
255 // use the page encoding even if this is a GET requests
256 request.setCharset(page.getCharset());
257 request.setRefererHeader(page.getUrl());
258
259 return request;
260 }
261
262 /**
263 * {@inheritDoc}

Callers 15

getWebResponseMethod · 0.95
cleanUpMethod · 0.45
getUrlMethod · 0.45
buildMessageMethod · 0.45
handleRefreshMethod · 0.45
isCacheableMethod · 0.45
getPageMethod · 0.45
loadWebResponseIntoMethod · 0.45
processOnlyHashChangeMethod · 0.45
cleanUpMethod · 0.45
getUrlMethod · 0.45
getSheetMethod · 0.45

Calls 11

getFullyQualifiedUrlMethod · 0.95
getHrefAttributeMethod · 0.95
getCssAcceptHeaderMethod · 0.95
setCharsetMethod · 0.95
getCharsetMethod · 0.95
setRefererHeaderMethod · 0.95
getPageMethod · 0.65
getWebClientMethod · 0.65
getUrlMethod · 0.65
getBrowserVersionMethod · 0.45

Tested by

no test coverage detected