org.apache.http.ProtocolException.printStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.apache.http.ProtocolException.printStackTrace()方法的一些代码示例,展示了ProtocolException.printStackTrace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ProtocolException.printStackTrace()方法的具体详情如下:
包路径:org.apache.http.ProtocolException
类名称:ProtocolException
方法名:printStackTrace

ProtocolException.printStackTrace介绍

暂无

代码示例

代码示例来源:origin: org.wildfly/wildfly-testsuite-shared

@Override
  public boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext context) {
    boolean isRedirect = false;
    try {
      isRedirect = super.isRedirected(request, response, context);
    } catch (ProtocolException e) {
      e.printStackTrace();
    }
    if (!isRedirect) {
      final int responseCode = response.getStatusLine().getStatusCode();
      isRedirect = (responseCode == 301 || responseCode == 302);
    }
    return isRedirect;
  }
};

代码示例来源:origin: gradle.plugin.me.taku_k.gradle.yarn/gradle-yarn-plugin

public boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext context)  {
    boolean isRedirect=false;
    try {
      isRedirect = super.isRedirected(request, response, context);
    } catch (ProtocolException e) {
      e.printStackTrace();
    }
    if (!isRedirect) {
      int responseCode = response.getStatusLine().getStatusCode();
      if (responseCode == 301 || responseCode == 302) {
        return true;
      }
    }
    return isRedirect;
  }
})

相关文章