Package com.gargoylesoftware.htmlunit.util

Examples of com.gargoylesoftware.htmlunit.util.NameValuePair


    /**
     * {@inheritDoc}
     */
    public NameValuePair[] getSubmitKeyValuePairs() {
        return new NameValuePair[]{new NameValuePair(getNameAttribute(), getValueAttribute())};
    }
View Full Code Here


        if (statusMessage == null) {
            statusMessage = "Unknown status code";
        }
        final List<NameValuePair> headers = new ArrayList<NameValuePair>();
        for (final Header header : method.getResponseHeaders()) {
            headers.add(new NameValuePair(header.getName(), header.getValue()));
        }
        final WebResponseData responseData = newWebResponseDataInstance(statusMessage, headers, statusCode, method);
        return newWebResponseInstance(responseData, loadTime, requestSettings);
    }
View Full Code Here

            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

        final NameValuePair[] pairs = new NameValuePair[selectedOptions.size()];

        int i = 0;
        for (final HtmlOption option : selectedOptions) {
            pairs[i++] = new NameValuePair(name, option.getValueAttribute());
        }
        return pairs;
    }
View Full Code Here

     * Returns "Submit Query" if <tt>name</tt> attribute is defined and <tt>value</tt> attribute is not defined.
     */
    @Override
    public NameValuePair[] getSubmitKeyValuePairs() {
        if (getNameAttribute().length() != 0 && !hasAttribute("value")) {
            return new NameValuePair[]{new NameValuePair(getNameAttribute(), DEFAULT_VALUE)};
        }
        return super.getSubmitKeyValuePairs();
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public NameValuePair[] getSubmitKeyValuePairs() {
        return new NameValuePair[]{new NameValuePair(getPromptAttribute(), getValue())};
    }
View Full Code Here

        else {
            prefix = name + ".";
        }

        if (wasPositionSpecified_) {
            final NameValuePair valueX = new NameValuePair(prefix + 'x', String.valueOf(xPosition_));
            final NameValuePair valueY = new NameValuePair(prefix + 'y', String.valueOf(yPosition_));
            if (prefix.length() > 0 && getPage().getWebClient().getBrowserVersion().isFirefox()) {
                return new NameValuePair[] {valueX, valueY,
                    new NameValuePair(getNameAttribute(), getValueAttribute()) };
            }
            return new NameValuePair[] {valueX, valueY};
        }
        return new NameValuePair[]{new NameValuePair(getNameAttribute(), getValueAttribute())};
    }
View Full Code Here

     */
    public NameValuePair[] getSubmitKeyValuePairs() {
        String text = getText();
        text = text.replace("\r\n", "\n").replace("\n", "\r\n");

        return new NameValuePair[]{new NameValuePair(getNameAttribute(), text)};
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public NameValuePair[] getSubmitKeyValuePairs() {
        return new NameValuePair[]{new NameValuePair(getNameAttribute(), getValueAttribute())};
    }
View Full Code Here

    static WebResponseData adaptResponse(InProcResponse inProcResponse) throws IOException {
        final List<NameValuePair> headers = new ArrayList<>();
        Collection<String> headerNames = inProcResponse.getHeaderNames();
        for (String headerName : headerNames) {
            String headerValue = inProcResponse.getHeader(headerName);
            headers.add(new NameValuePair(headerName, headerValue));
        }
        return new WebResponseData(inProcResponse.getContentBytes(), inProcResponse.getStatus(), inProcResponse.getReason(), headers);
    }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.util.NameValuePair

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.