code: public void setMaxRedirects(int maxRedirects) {
          if (maxRedirects < 0) {
              throw new IllegalArgumentException("Parameter maxRedirects must be greater or equal to zero.");
          }
          client.getParams().setIntParameter(HttpClientParams.MAX_REDIRECTS, maxRedirects);
          clientViaProxy.getParams().setIntParameter(HttpClientParams.MAX_REDIRECTS, maxRedirects);
      }
docs: Sets the maximum number of redirects that will be followed before failing with an exception.
  <p>
  The default maximum number of redirects is 100.
  
  @param maxRedirects the maximum number of redirects
  @throws IllegalArgumentException if {@code maxRedirects} is negative.
  @since 2.4.0