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
()
| 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} |
no test coverage detected