HTTPGet无法正常工作

时间:2018-01-14 22:49:09

标签: java http apache-httpclient-4.x

HttpResponse executeGet(String url) {
    log.error("Inside execute Get");
    HttpResponse response = null;
    HttpGet request = null;
    try {
        log.error("Inside execute Get 1");
        request = new HttpGet(url);
        log.error("Inside execute Get 2");
        response = executeHttpRequest(request);
    } catch (Exception ex) {
        log.error("Error in HTTP Get : " + ex);
    }
    log.error("Request " + request.toString());
    log.error("Response " + response.toString());
    return response;
}

我正在调用此方法进行批处理。只有声明"内部执行Get 1"正在打印在日志中。它也没有抛出任何异常。任何帮助,将不胜感激 ! :)

0 个答案:

没有答案