Package org.apache.wink.client

Examples of org.apache.wink.client.ClientConfig.followRedirects()


    public void testConfiguration() {
        ClientConfig conf = new ClientConfig();
        conf.proxyHost("localhost").proxyPort(8080);
        conf.connectTimeout(6000);
        conf.followRedirects(true);

        assertEquals(conf.getProxyHost(), "localhost");
        assertEquals(conf.getProxyPort(), 8080);
        assertEquals(conf.getConnectTimeout(), 6000);
        assertEquals(conf.isFollowRedirects(), true);
View Full Code Here


        log.debug("Opening w/username: {}", username);

        // Using Apache HttpClient here, as it appears the default wink client does not handle redirects properly, even when configured to do so
        HttpClient httpClient = new DefaultHttpClient();
        ClientConfig config = new ApacheHttpClientConfig(httpClient);
        config.followRedirects(true);

        config.handlers(
            new LoggingHandler(log, /*debug*/ false),
            new BasicAuthSecurityHandler(username, password)
        );
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.