Java 类org.apache.http.client.methods.HttpHeadHC4 实例源码

项目:remote-files-sync    文件:DefaultRedirectStrategy.java   
public HttpUriRequest getRedirect(
        final HttpRequest request,
        final HttpResponse response,
        final HttpContext context) throws ProtocolException {
    final URI uri = getLocationURI(request, response, context);
    final String method = request.getRequestLine().getMethod();
    if (method.equalsIgnoreCase(HttpHeadHC4.METHOD_NAME)) {
        return new HttpHeadHC4(uri);
    } else if (method.equalsIgnoreCase(HttpGetHC4.METHOD_NAME)) {
        return new HttpGetHC4(uri);
    } else {
        final int status = response.getStatusLine().getStatusCode();
        if (status == HttpStatus.SC_TEMPORARY_REDIRECT) {
            return RequestBuilder.copy(request).setUri(uri).build();
        } else {
            return new HttpGetHC4(uri);
        }
    }
}
项目:Visit    文件:DefaultRedirectStrategy.java   
public HttpUriRequest getRedirect(
        final HttpRequest request,
        final HttpResponse response,
        final HttpContext context) throws ProtocolException {
    final URI uri = getLocationURI(request, response, context);
    final String method = request.getRequestLine().getMethod();
    if (method.equalsIgnoreCase(HttpHeadHC4.METHOD_NAME)) {
        return new HttpHeadHC4(uri);
    } else if (method.equalsIgnoreCase(HttpGetHC4.METHOD_NAME)) {
        return new HttpGetHC4(uri);
    } else {
        final int status = response.getStatusLine().getStatusCode();
        if (status == HttpStatus.SC_TEMPORARY_REDIRECT) {
            return RequestBuilder.copy(request).setUri(uri).build();
        } else {
            return new HttpGetHC4(uri);
        }
    }
}
项目:ZTLib    文件:DefaultRedirectStrategy.java   
public HttpUriRequest getRedirect(
        final HttpRequest request,
        final HttpResponse response,
        final HttpContext context) throws ProtocolException {
    final URI uri = getLocationURI(request, response, context);
    final String method = request.getRequestLine().getMethod();
    if (method.equalsIgnoreCase(HttpHeadHC4.METHOD_NAME)) {
        return new HttpHeadHC4(uri);
    } else if (method.equalsIgnoreCase(HttpGetHC4.METHOD_NAME)) {
        return new HttpGetHC4(uri);
    } else {
        final int status = response.getStatusLine().getStatusCode();
        if (status == HttpStatus.SC_TEMPORARY_REDIRECT) {
            return RequestBuilder.copy(request).setUri(uri).build();
        } else {
            return new HttpGetHC4(uri);
        }
    }
}