Package org.apache.http.client.config.RequestConfig

Examples of org.apache.http.client.config.RequestConfig.Builder


    RestTemplate client = new RestTemplate();
    client.setRequestFactory(new HttpComponentsClientHttpRequestFactory() {
      @Override
      protected HttpContext createHttpContext(HttpMethod httpMethod, URI uri) {
        HttpClientContext context = HttpClientContext.create();
        Builder builder = RequestConfig.custom().setCookieSpec(CookieSpecs.IGNORE_COOKIES)
            .setAuthenticationEnabled(false).setRedirectsEnabled(false);
        context.setRequestConfig(builder.build());
        return context;
      }
    });
    client.setErrorHandler(new DefaultResponseErrorHandler() {
      @Override
View Full Code Here


      context.setRequestConfig(getRequestConfig());
      return context;
    }

    protected RequestConfig getRequestConfig() {
      Builder builder = RequestConfig.custom().setCookieSpec(this.cookieSpec)
          .setAuthenticationEnabled(false)
          .setRedirectsEnabled(this.enableRedirects);
      return builder.build();
    }
View Full Code Here

TOP

Related Classes of org.apache.http.client.config.RequestConfig.Builder

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.