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

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

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

HttpResponse.getHttpRequest介绍

[英]Returns jodd.http.HttpRequest that created this response.
[中]乔德回来了。http。创建此响应的HttpRequest。

代码示例

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

/**
 * Parses 'location' header to return the next location or returns {@code null} if location not specified.
 * Specification (<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30">rfc2616</a>)
 * says that only absolute path must be provided, however, this does not
 * happens in the real world. There a <a href="https://tools.ietf.org/html/rfc7231#section-7.1.2">proposal</a>
 * that allows server name etc to be omitted.
 */
public String location() {
  String location = header("location");
  if (location == null) {
    return null;
  }
  if (location.startsWith(StringPool.SLASH)) {
    location = getHttpRequest().hostUrl() + location;
  }
  return location;
}

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

boolean keepAlive = httpResponse.isConnectionPersistent();
if (keepAlive) {
  HttpConnection previousConnection = httpResponse.getHttpRequest().httpConnection;
    this.httpConnectionProvider = httpResponse.getHttpRequest().connectionProvider();
  open(httpResponse.getHttpRequest().connectionProvider());

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

/**
 * Parses 'location' header to return the next location or returns {@code null} if location not specified.
 * Specification (<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30">rfc2616</a>)
 * says that only absolute path must be provided, however, this does not
 * happens in the real world. There a <a href="https://tools.ietf.org/html/rfc7231#section-7.1.2">proposal</a>
 * that allows server name etc to be omitted.
 */
public String location() {
  String location = header("location");
  if (location == null) {
    return null;
  }
  if (location.startsWith(StringPool.SLASH)) {
    location = getHttpRequest().hostUrl() + location;
  }
  return location;
}

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

boolean keepAlive = httpResponse.isConnectionPersistent();
if (keepAlive) {
  HttpConnection previousConnection = httpResponse.getHttpRequest().httpConnection;
    this.httpConnectionProvider = httpResponse.getHttpRequest().connectionProvider();
  open(httpResponse.getHttpRequest().connectionProvider());

相关文章