--- solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java 2013-10-28 16:18:21.801247400 -0400 +++ solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java 2013-12-11 10:38:22.075674800 -0500 @@ -199,8 +199,11 @@ return request(request, responseParser); } - public NamedList request(final SolrRequest request, - final ResponseParser processor) throws SolrServerException, IOException { + public NamedList request(final SolrRequest request, final ResponseParser processor) throws SolrServerException, IOException { + return executeMethod(request,createMethod(request),processor); + } + + protected HttpRequestBase createMethod(final SolrRequest request) throws IOException, SolrServerException { HttpRequestBase method = null; InputStream is = null; SolrParams params = request.getParams(); @@ -382,6 +385,10 @@ throw new SolrServerException("error reading streams", ex); } + return method; + } + + protected NamedList executeMethod(final SolrRequest request, HttpRequestBase method, final ResponseParser processor) throws SolrServerException { // XXX client already has this set, is this needed? method.getParams().setParameter(ClientPNames.HANDLE_REDIRECTS, followRedirects);