org.apache.http.protocol.HttpProcessor#org.apache.http.client.RedirectHandler源码实例Demo

下面列出了org.apache.http.protocol.HttpProcessor#org.apache.http.client.RedirectHandler 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: google-http-java-client   文件: MockHttpClient.java
@Override
protected RequestDirector createClientRequestDirector(
    HttpRequestExecutor requestExec,
    ClientConnectionManager conman,
    ConnectionReuseStrategy reustrat,
    ConnectionKeepAliveStrategy kastrat,
    HttpRoutePlanner rouplan,
    HttpProcessor httpProcessor,
    HttpRequestRetryHandler retryHandler,
    RedirectHandler redirectHandler,
    AuthenticationHandler targetAuthHandler,
    AuthenticationHandler proxyAuthHandler,
    UserTokenHandler stateHandler,
    HttpParams params) {
  return new RequestDirector() {
    @Beta
    public HttpResponse execute(HttpHost target, HttpRequest request, HttpContext context)
        throws HttpException, IOException {
      return new BasicHttpResponse(HttpVersion.HTTP_1_1, responseCode, null);
    }
  };
}
 
源代码2 项目: YiBo   文件: LibHttpClient.java
@Override
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler stateHandler,
        final HttpParams params) {
    return new LibRequestDirector(
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectHandler,
            targetAuthHandler,
            proxyAuthHandler,
            stateHandler,
            params);
}
 
源代码3 项目: MiBandDecompiled   文件: AsyncHttpClient.java
public void setRedirectHandler(RedirectHandler redirecthandler)
{
    c.setRedirectHandler(redirecthandler);
}
 
源代码4 项目: YiBo   文件: LibRequestDirector.java
public LibRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {

    if (requestExec == null) {
        throw new IllegalArgumentException("Request executor may not be null.");
    }
    if (conman == null) {
        throw new IllegalArgumentException("Client connection manager may not be null.");
    }
    if (reustrat == null) {
        throw new IllegalArgumentException("Connection reuse strategy may not be null.");
    }
    if (kastrat == null) {
        throw new IllegalArgumentException("Connection keep alive strategy may not be null.");
    }
    if (rouplan == null) {
        throw new IllegalArgumentException("Route planner may not be null.");
    }
    if (httpProcessor == null) {
        throw new IllegalArgumentException("HTTP protocol processor may not be null.");
    }
    if (retryHandler == null) {
        throw new IllegalArgumentException("HTTP request retry handler may not be null.");
    }
    if (redirectHandler == null) {
        throw new IllegalArgumentException("Redirect handler may not be null.");
    }
    if (targetAuthHandler == null) {
        throw new IllegalArgumentException("Target authentication handler may not be null.");
    }
    if (proxyAuthHandler == null) {
        throw new IllegalArgumentException("Proxy authentication handler may not be null.");
    }
    if (userTokenHandler == null) {
        throw new IllegalArgumentException("User token handler may not be null.");
    }
    if (params == null) {
        throw new IllegalArgumentException("HTTP parameters may not be null");
    }
    this.requestExec       = requestExec;
    this.connManager       = conman;
    this.reuseStrategy     = reustrat;
    this.keepAliveStrategy = kastrat;
    this.routePlanner      = rouplan;
    this.httpProcessor     = httpProcessor;
    this.retryHandler      = retryHandler;
    this.redirectHandler   = redirectHandler;
    this.targetAuthHandler = targetAuthHandler;
    this.proxyAuthHandler  = proxyAuthHandler;
    this.userTokenHandler  = userTokenHandler;
    this.params            = params;

    this.managedConn       = null;

    this.execCount = 0;
    this.redirectCount = 0;
    this.maxRedirects = this.params.getIntParameter(ClientPNames.MAX_REDIRECTS, 100);
    this.targetAuthState = new AuthState();
    this.proxyAuthState = new AuthState();
}
 
源代码5 项目: Mobike   文件: AsyncHttpClient.java
/**
 * Allows you to set custom RedirectHandler implementation, if the default provided doesn't suit
 * your needs
 *
 * @param customRedirectHandler RedirectHandler instance
 * @see MyRedirectHandler
 */
public void setRedirectHandler(final RedirectHandler customRedirectHandler) {
    httpClient.setRedirectHandler(customRedirectHandler);
}
 
源代码6 项目: AndroidWear-OpenWear   文件: AsyncHttpClient.java
/**
 * Allows you to set custom RedirectHandler implementation, if the default
 * provided doesn't suit your needs
 *
 * @param customRedirectHandler RedirectHandler instance
 * @see cn.openwatch.internal.http.loopj.MyRedirectHandler
 */
public void setRedirectHandler(final RedirectHandler customRedirectHandler) {
    httpClient.setRedirectHandler(customRedirectHandler);
}
 
源代码7 项目: android-project-wo2b   文件: AsyncHttpClient.java
/**
 * Allows you to set custom RedirectHandler implementation, if the default provided doesn't suit
 * your needs
 *
 * @param customRedirectHandler RedirectHandler instance
 * @see com.wo2b.sdk.common.util.http.MyRedirectHandler
 */
public void setRedirectHandler(final RedirectHandler customRedirectHandler) {
    httpClient.setRedirectHandler(customRedirectHandler);
}
 
源代码8 项目: Android-Basics-Codes   文件: AsyncHttpClient.java
/**
 * Allows you to set custom RedirectHandler implementation, if the default provided doesn't suit
 * your needs
 *
 * @param customRedirectHandler RedirectHandler instance
 * @see com.loopj.android.http.MyRedirectHandler
 */
public void setRedirectHandler(final RedirectHandler customRedirectHandler) {
    httpClient.setRedirectHandler(customRedirectHandler);
}
 
源代码9 项目: Android-Basics-Codes   文件: AsyncHttpClient.java
/**
 * Allows you to set custom RedirectHandler implementation, if the default provided doesn't suit
 * your needs
 *
 * @param customRedirectHandler RedirectHandler instance
 * @see com.loopj.android.http.MyRedirectHandler
 */
public void setRedirectHandler(final RedirectHandler customRedirectHandler) {
    httpClient.setRedirectHandler(customRedirectHandler);
}
 
源代码10 项目: Android-Basics-Codes   文件: AsyncHttpClient.java
/**
 * Allows you to set custom RedirectHandler implementation, if the default provided doesn't suit
 * your needs
 *
 * @param customRedirectHandler RedirectHandler instance
 * @see com.loopj.android.http.MyRedirectHandler
 */
public void setRedirectHandler(final RedirectHandler customRedirectHandler) {
    httpClient.setRedirectHandler(customRedirectHandler);
}