io.micronaut.http.HttpResponse.getHeaders()方法的使用及代码示例

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

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

HttpResponse.getHeaders介绍

暂无

代码示例

代码示例来源:origin: micronaut-projects/micronaut-core

/**
 * Return the first value for the given header or null.
 *
 * @param name The name
 * @return The header value
 */
default @Nullable String header(@Nullable CharSequence name) {
  if (name == null) {
    return null;
  }
  return getHeaders().get(name);
}

代码示例来源:origin: micronaut-projects/micronaut-core

@Override
  public Publisher<? extends HttpResponse<?>> doFilter(HttpRequest<?> request, FilterChain chain) {
    request.getAttributes().put("first", true);
    Assert.that(!request.getAttributes().contains("authenticated"));
    Publisher<? extends HttpResponse<?>> publisher = chain.proceed(request);
    return Publishers.then(publisher, httpResponse -> {
      httpResponse.getHeaders();
    });
  }
}

代码示例来源:origin: io.micronaut/micronaut-http

/**
 * Return the first value for the given header or null.
 *
 * @param name The name
 * @return The header value
 */
default @Nullable String header(@Nullable CharSequence name) {
  if (name == null) {
    return null;
  }
  return getHeaders().get(name);
}

相关文章