jodd.http.HttpResponse.isConnectionPersistent()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(188)

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

HttpResponse.isConnectionPersistent介绍

暂无

代码示例

代码示例来源:origin: oblac/jodd

private HttpResponse _send() {
  if (httpConnection == null) {
    open();
  }
  // sends data
  final HttpResponse httpResponse;
  try {
    OutputStream outputStream = httpConnection.getOutputStream();
    sendTo(outputStream);
    InputStream inputStream = httpConnection.getInputStream();
    httpResponse = HttpResponse.readFrom(inputStream);
    httpResponse.assignHttpRequest(this);
  } catch (IOException ioex) {
    throw new HttpException(ioex);
  }
  boolean keepAlive = httpResponse.isConnectionPersistent();
  if (!keepAlive) {
    // closes connection if keep alive is false, or if counter reached 0
    httpConnection.close();
    httpConnection = null;
  }
  return httpResponse;
}

代码示例来源:origin: oblac/jodd

boolean keepAlive = httpResponse.isConnectionPersistent();
if (keepAlive) {
  HttpConnection previousConnection = httpResponse.getHttpRequest().httpConnection;

代码示例来源:origin: oblac/jodd

assertTrue(response.isConnectionPersistent());
assertNotNull(request.connection());
assertTrue(response.isConnectionPersistent());
assertNotNull(request.connection());
assertFalse(response.isConnectionPersistent());
assertTrue(response.isConnectionPersistent());
assertNotNull(request.connection());

代码示例来源:origin: oblac/jodd

assertTrue(response.isConnectionPersistent());
assertNotNull(request.connection());
assertTrue(response.isConnectionPersistent());
assertNotNull(request.connection());
assertFalse(response.isConnectionPersistent());
assertTrue(response.isConnectionPersistent());
assertNotNull(request.connection());

代码示例来源:origin: org.jodd/jodd-http

private HttpResponse _send() {
  if (httpConnection == null) {
    open();
  }
  // sends data
  final HttpResponse httpResponse;
  try {
    OutputStream outputStream = httpConnection.getOutputStream();
    sendTo(outputStream);
    InputStream inputStream = httpConnection.getInputStream();
    httpResponse = HttpResponse.readFrom(inputStream);
    httpResponse.assignHttpRequest(this);
  } catch (IOException ioex) {
    throw new HttpException(ioex);
  }
  boolean keepAlive = httpResponse.isConnectionPersistent();
  if (!keepAlive) {
    // closes connection if keep alive is false, or if counter reached 0
    httpConnection.close();
    httpConnection = null;
  }
  return httpResponse;
}

代码示例来源:origin: org.jodd/jodd-http

boolean keepAlive = httpResponse.isConnectionPersistent();
if (keepAlive) {
  HttpConnection previousConnection = httpResponse.getHttpRequest().httpConnection;

相关文章