Package org.apache.http.impl.client

Examples of org.apache.http.impl.client.DefaultRedirectStrategy


          .build())
        .setDefaultCredentialsProvider(credentialsProvider);
      if (myFactory != null)
        builder.setSSLSocketFactory(myFactory);
      builder.setRequestExecutor(new HttpRequestExecutor(socketTimeout))
        .setRedirectStrategy(new DefaultRedirectStrategy());
      httpClient = builder.build();

      proxy = new SPSProxyHelper( serverUrl, encodedServerLocation, serverLocation, userName, password,
        org.apache.manifoldcf.core.common.CommonsHTTPSender.class, "client-config.wsdd",
        httpClient );
View Full Code Here


          .setTcpNoDelay(true)
          .setSoTimeout(socketTimeout)
          .build())
        .setDefaultCredentialsProvider(credentialsProvider)
        .setRequestExecutor(new HttpRequestExecutor(socketTimeout))
        .setRedirectStrategy(new DefaultRedirectStrategy());

      if (myFactory != null)
        builder.setSSLSocketFactory(myFactory);
     
      httpClient = builder.build();
View Full Code Here

            return false;
          }

          @Override
          public HttpUriRequest getRedirect(HttpRequest hr, HttpResponse hr1, HttpContext hc) throws ProtocolException {
            return new DefaultRedirectStrategy().getRedirect(hr, hr1, hc);
          }
        });


        HttpResponse resp = client.execute(get);
View Full Code Here

    ClientConnectionManager ccm = new ThreadSafeClientConnManager(supportedSchemes);
    DefaultHttpClient httpclient = new DefaultHttpClient(ccm, params);

    if (!allowRedirectFollow) {
      // Do NOT allow for 302 REDIRECT
      httpclient.setRedirectStrategy(new DefaultRedirectStrategy() {
        public boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext context) {
          boolean isRedirect = false;
          try {
            isRedirect = super.isRedirected(request, response, context);
          } catch (ProtocolException e) {
View Full Code Here

    }

    @Test
    public void testServletFormAuth() throws IOException {
        TestHttpClient client = new TestHttpClient();
        client.setRedirectStrategy(new DefaultRedirectStrategy() {
            @Override
            public boolean isRedirected(final HttpRequest request, final HttpResponse response, final HttpContext context) throws ProtocolException {
                if (response.getStatusLine().getStatusCode() == 302) {
                    return true;
                }
View Full Code Here

    }

    @Test
    public void testServletFormAuthWithSavedPostBody() throws IOException {
        TestHttpClient client = new TestHttpClient();
        client.setRedirectStrategy(new DefaultRedirectStrategy() {
            @Override
            public boolean isRedirected(final HttpRequest request, final HttpResponse response, final HttpContext context) throws ProtocolException {
                if (response.getStatusLine().getStatusCode() == 302) {
                    return true;
                }
View Full Code Here


    @Test
    public void testServletFormAuthWithOriginalRequestParams() throws IOException {
        TestHttpClient client = new TestHttpClient();
        client.setRedirectStrategy(new DefaultRedirectStrategy() {
            @Override
            public boolean isRedirected(final HttpRequest request, final HttpResponse response, final HttpContext context) throws ProtocolException {
                if (response.getStatusLine().getStatusCode() == 302) {
                    return true;
                }
View Full Code Here

    }

    @Test
    public void testServletCustomFormAuth() throws IOException {
        TestHttpClient client = new TestHttpClient();
        client.setRedirectStrategy(new DefaultRedirectStrategy() {
            @Override
            public boolean isRedirected(final HttpRequest request, final HttpResponse response, final HttpContext context) throws ProtocolException {
                if (response.getStatusLine().getStatusCode() == 302) {
                    return true;
                }
View Full Code Here

    }

    private TestHttpClient createHttpClient() {
        TestHttpClient client = new TestHttpClient();

        client.setRedirectStrategy(new DefaultRedirectStrategy() {
            @Override
            public boolean isRedirected(final HttpRequest request, final HttpResponse response, final HttpContext context) throws ProtocolException {
                if (response.getStatusLine().getStatusCode() == 302) {
                    return true;
                }
View Full Code Here

        params.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY,true);
        params.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK,false);
        params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,socketTimeOut);
        params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,connectionTimeOut);
        client = new DefaultHttpClient(httpConnectionManager,params);
        client.setRedirectStrategy(new DefaultRedirectStrategy());
        core.addCloseHook(new CloseHandler());
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.http.impl.client.DefaultRedirectStrategy

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.