Package com.volantis.shared.net.http.client

Examples of com.volantis.shared.net.http.client.HttpClientBuilder


     * Prepare HTTPClient for request,
     * Set headers if are pass in parameters
     */
    private HttpClient prepareHttpClient() {
        HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        HttpClientBuilder builder = factory.createClientBuilder();
        builder.setConnectionTimeout(CONNECTION_TIMEOUT);
        builder.setRoundTripTimeout(ROUNDTRIP_TIMEOUT);
        return builder.buildHttpClient();
    }
View Full Code Here


        final HttpState state = new HttpState();
        state.setCookiePolicy(CookiePolicy.COMPATIBILITY);

        HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        HttpClientBuilder builder = factory.createClientBuilder();
        builder.setState(state);
        builder.setConnectionTimeout(timeout);
        builder.setRoundTripTimeout(timeout);

        // create the HTTPClient instance.
        final HttpClient httpClient = builder.buildHttpClient();

        // return an HTTPRequestExecutor that uses HttpClient to perform
        // the request
        return new HTTPRequestExecutor() {
View Full Code Here

                               final HttpUrlConfiguration httpConfig)
            throws IOException {
        // Create a HTTP Client which will timeout connections and round trips
        // in the specified period.
        final HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        final HttpClientBuilder builder = factory.createClientBuilder();
        builder.setConnectionTimeout(timeout);
        builder.setRoundTripTimeout(timeout);
        final HttpClient httpClient = builder.buildHttpClient();

        final GetMethod method = new GetMethod(url.toExternalForm());
        final HostConfiguration configuration = new HostConfiguration();
        configuration.setHost(url.getHost(), url.getPort(), url.getProtocol());
        method.setHostConfiguration(configuration);
View Full Code Here

        GetMethod method = new GetMethod(url);
        method.setHttp11(false);

        HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        HttpClientBuilder builder = factory.createClientBuilder();
        builder.setConnectionTimeout(connectionTimeout);
        builder.setRoundTripTimeout(connectionTimeout);
        HttpClient httpClient = builder.buildHttpClient();

        URL netURL = null;
        try {
            netURL = new URL(url);
        } catch (MalformedURLException e) {
View Full Code Here

                method.addRequestHeader("Host",
                        url.getHost() + ":" + url.getPort());
            }

            HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
            HttpClientBuilder builder = factory.createClientBuilder();
            HttpClient httpClient = builder.buildHttpClient();
            httpClient.executeMethod(method);
        }
        return method;
    }
View Full Code Here

TOP

Related Classes of com.volantis.shared.net.http.client.HttpClientBuilder

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.