Examples of loadWebResponse()


Examples of com.gargoylesoftware.htmlunit.WebClient.loadWebResponse()

            final HtmlPage page = (HtmlPage) getPage();
            final WebClient webclient = page.getWebClient();

            final String src = getArchiveAttribute();
            final URL url = page.getFullyQualifiedUrl(src);
            appletWebResponse_ = webclient.loadWebResponse(new WebRequestSettings(url));

            downloaded_ = true;
        }

        appletClassLoader_ = new AppletClassLoader();
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.loadWebResponse()

            final URL url = page.getFullyQualifiedUrl(getSrcAttribute());
            final WebRequestSettings request = new WebRequestSettings(url);
            request.setAdditionalHeader("Referer",
                page.getWebResponse().getRequestSettings().getUrl().toExternalForm());
            imageWebResponse_ = webclient.loadWebResponse(request);
            downloaded_ = true;
        }
    }

    private void readImageIfNeeded() throws IOException {
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.loadWebResponse()

     */
    private void doSend(final Context context) {
        final WebClient wc = getWindow().getWebWindow().getWebClient();
        try {
            setState(STATE_LOADED, context);
            final WebResponse webResponse = wc.loadWebResponse(requestSettings_);
            LOG.debug("Web response loaded successfully.");
            if (overriddenMimeType_ == null) {
                webResponse_ = webResponse;
            }
            else {
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.loadWebResponse()

            final Object fromCache = cache.getCachedObject(request);
            if (fromCache != null && fromCache instanceof CSSStyleSheet) {
                sheet = new Stylesheet(element, (CSSStyleSheet) fromCache, uri);
            }
            else {
                final WebResponse response = client.loadWebResponse(request);
                uri = response.getRequestSettings().getUrl().toExternalForm();
                client.printContentIfNecessary(response);
                client.throwFailingHttpStatusCodeExceptionIfNecessary(response);
                // CSS content must have downloaded OK; go ahead and build the corresponding stylesheet.
                final String css = response.getContentAsString();
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.loadWebResponse()

        final Object cachedScript = cache.getCachedObject(request);
        if (cachedScript instanceof Script) {
            return (Script) cachedScript;
        }

        final WebResponse response = client.loadWebResponse(request);
        client.printContentIfNecessary(response);
        client.throwFailingHttpStatusCodeExceptionIfNecessary(response);

        final int statusCode = response.getStatusCode();
        final boolean successful = (statusCode >= HttpStatus.SC_OK && statusCode < HttpStatus.SC_MULTIPLE_CHOICES);
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.loadWebResponse()

     * @throws IOException if an error occurs while downloading the content
     */
    public WebResponse getWebResponse(final boolean downloadIfNeeded) throws IOException {
        if (downloadIfNeeded && cachedWebResponse_ == null) {
            final WebClient webclient = getPage().getWebClient();
            cachedWebResponse_ = webclient.loadWebResponse(getWebRequestSettings());
        }
        return cachedWebResponse_;
    }

    /**
 
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.loadWebResponse()

        public void run() {
            final WebClient client = getWindow().getWebWindow().getWebClient();
            final Scriptable scope = callback_.getParentScope();
            final WebRequestSettings settings = new WebRequestSettings(url_);
            try {
                final WebResponse webResponse = client.loadWebResponse(settings);
                final String content = webResponse.getContentAsString();
                LOG.debug("Downloaded content: " + StringUtils.abbreviate(content, 512));
                final Object[] args = new Object[] {content};
                final ContextAction action = new ContextAction() {
                    public Object run(final Context cx) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.