hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Redirection not happening?
Date Wed, 17 Feb 2016 14:04:58 GMT
On Tue, 2016-02-16 at 17:03 -0500, Karl Wright wrote:
> Oh, FWIW, this is httpcomponents/httpclient 4.4.1.
> Karl
> 
> 

Hi Karl

What kind of request method is it? Per RFC 2616 there are certain
restrictions on automatic redirects of some methods such as POST and
PUT.

Oleg 

> On Tue, Feb 16, 2016 at 4:58 PM, Karl Wright <daddywri@gmail.com> wrote:
> 
> > Hi folks,
> >
> > The ManifoldCF SharePoint connector has the following code to set up its
> > HttpClient instance:
> >
> > >>>>>>
> >       RequestConfig.Builder requestBuilder = RequestConfig.custom()
> >           .setCircularRedirectsAllowed(true)
> >           .setSocketTimeout(socketTimeout)
> >           .setExpectContinueEnabled(false)
> >           .setConnectTimeout(connectionTimeout)
> >           .setConnectionRequestTimeout(socketTimeout);
> >
> >       // If there's a proxy, set that too.
> >       if (proxyHost != null && proxyHost.length() > 0)
> >       {
> >
> >         // Configure proxy authentication
> >         if (proxyUsername != null && proxyUsername.length() > 0)
> >         {
> >           if (proxyPassword == null)
> >             proxyPassword = "";
> >           if (proxyDomain == null)
> >             proxyDomain = "";
> >
> >           credentialsProvider.setCredentials(
> >             new AuthScope(proxyHost, proxyPort),
> >             new NTCredentials(proxyUsername, proxyPassword, currentHost,
> > proxyDomain));
> >         }
> >
> >         HttpHost proxy = new HttpHost(proxyHost, proxyPort);
> >
> >         requestBuilder.setProxy(proxy);
> >       }
> >
> >       HttpClientBuilder builder = HttpClients.custom()
> >         .setConnectionManager(connectionManager)
> >         .disableAutomaticRetries()
> >         .setDefaultRequestConfig(requestBuilder.build())
> >         .setDefaultCredentialsProvider(credentialsProvider);
> >       builder.setRequestExecutor(new HttpRequestExecutor(socketTimeout))
> >         .setRedirectStrategy(new DefaultRedirectStrategy());
> >       httpClient = builder.build();
> > <<<<<<
> >
> > This works fine for the most part, except for one thing: it apparently
> > doesn't follow 302 redirections, for some reason.  Any idea why?
> >
> > Thanks in advance,
> > Karl
> >
> >



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message