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

项目: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);
        }
    }
}
项目:PeSanKita-android    文件:IncomingLegacyMmsConnection.java   
private HttpUriRequest constructRequest(Apn contentApn, boolean useProxy) throws IOException {
  HttpGetHC4 request = new HttpGetHC4(contentApn.getMmsc());
  for (Header header : getBaseHeaders()) {
    request.addHeader(header);
  }
  if (useProxy) {
    HttpHost proxy = new HttpHost(contentApn.getProxy(), contentApn.getPort());
    request.setConfig(RequestConfig.custom().setProxy(proxy).build());
  }
  return request;
}
项目:Cable-Android    文件:IncomingLegacyMmsConnection.java   
private HttpUriRequest constructRequest(Apn contentApn, boolean useProxy) throws IOException {
  HttpGetHC4 request = new HttpGetHC4(contentApn.getMmsc());
  for (Header header : getBaseHeaders()) {
    request.addHeader(header);
  }
  if (useProxy) {
    HttpHost proxy = new HttpHost(contentApn.getProxy(), contentApn.getPort());
    request.setConfig(RequestConfig.custom().setProxy(proxy).build());
  }
  return request;
}
项目:TextSecure    文件:IncomingMmsConnection.java   
@Override
protected HttpUriRequest constructRequest(boolean useProxy) throws IOException {
  HttpGetHC4 request = new HttpGetHC4(apn.getMmsc());
  request.addHeader("Accept", "*/*, application/vnd.wap.mms-message, application/vnd.wap.sic");
  if (useProxy) {
    HttpHost proxy = new HttpHost(apn.getProxy(), apn.getPort());
    request.setConfig(RequestConfig.custom().setProxy(proxy).build());
  }
  return request;
}
项目:TextSecureSMP    文件:IncomingLegacyMmsConnection.java   
private HttpUriRequest constructRequest(Apn contentApn, boolean useProxy) throws IOException {
  HttpGetHC4 request = new HttpGetHC4(contentApn.getMmsc());
  for (Header header : getBaseHeaders()) {
    request.addHeader(header);
  }
  if (useProxy) {
    HttpHost proxy = new HttpHost(contentApn.getProxy(), contentApn.getPort());
    request.setConfig(RequestConfig.custom().setProxy(proxy).build());
  }
  return request;
}
项目:Silence    文件:IncomingLegacyMmsConnection.java   
private HttpUriRequest constructRequest(Apn contentApn, boolean useProxy) throws IOException {
  HttpGetHC4 request = new HttpGetHC4(contentApn.getMmsc());
  for (Header header : getBaseHeaders()) {
    request.addHeader(header);
  }
  if (useProxy) {
    HttpHost proxy = new HttpHost(contentApn.getProxy(), contentApn.getPort());
    request.setConfig(RequestConfig.custom().setProxy(proxy).build());
  }
  return request;
}
项目:Securecom-Messaging    文件:IncomingMmsConnection.java   
@Override
protected HttpUriRequest constructRequest(boolean useProxy) throws IOException {
  HttpGetHC4 request = new HttpGetHC4(apn.getMmsc());
  request.addHeader("Accept", "*/*, application/vnd.wap.mms-message, application/vnd.wap.sic");
  if (useProxy) {
    HttpHost proxy = new HttpHost(apn.getProxy(), apn.getPort());
    request.setConfig(RequestConfig.custom().setProxy(proxy).build());
  }
  return request;
}