Package com.gargoylesoftware.htmlunit.protocol.data

Examples of com.gargoylesoftware.htmlunit.protocol.data.DataUrlDecoder


    }

    private WebResponse makeWebResponseForDataUrl(final WebRequestSettings webRequestSettings) throws IOException {
        final URL url = webRequestSettings.getUrl();
        final List<NameValuePair> responseHeaders = new ArrayList<NameValuePair>();
        DataUrlDecoder decoder;
        try {
            decoder = DataUrlDecoder.decode(url);
        }
        catch (final DecoderException e) {
            throw new IOException(e.getMessage());
        }
        responseHeaders.add(new NameValuePair("content-type",
            decoder.getMediaType() + ";charset=" + decoder.getCharset()));
        final WebResponseData data = new WebResponseData(url.openStream(), 200, "OK", responseHeaders);
        return new WebResponseImpl(data, url, webRequestSettings.getHttpMethod(), 0);
    }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.protocol.data.DataUrlDecoder

Copyright © 2018 www.massapicom. 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.