co.cask.common.http.HttpResponse.getHeaders()方法的使用及代码示例

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

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

HttpResponse.getHeaders介绍

暂无

代码示例

代码示例来源:origin: cdapio/cdap

/**
  * Returns the first value of the given header from the given response. If there is no such header, {@code null} is
  * returned.
  */
 @Nullable
 private static String getFirstHeaderValue(HttpResponse response, String name) {
  return response.getHeaders().get(name).stream().findFirst().orElse(null);
 }
}

代码示例来源:origin: co.cask.cdap/cdap-tms

@Nullable
@Override
public RollbackDetail publish(StoreRequest request) throws TopicNotFoundException, IOException {
 HttpResponse response = performWriteRequest(request, true);
 byte[] body = response.getResponseBody();
 if (body.length == 0) {
  return null;
 }
 // It has rollback detail, verify the content-type and decode it
 verifyContentType(response.getHeaders().asMap(), "avro/binary");
 return new ClientRollbackDetail(body);
}

代码示例来源:origin: caskdata/cdap

@Nullable
@Override
public RollbackDetail publish(StoreRequest request) throws TopicNotFoundException, IOException {
 HttpResponse response = performWriteRequest(request, true);
 byte[] body = response.getResponseBody();
 if (body.length == 0) {
  return null;
 }
 // It has rollback detail, verify the content-type and decode it
 verifyContentType(response.getHeaders().asMap(), "avro/binary");
 return new ClientRollbackDetail(body);
}

代码示例来源:origin: caskdata/cdap

for (Map.Entry<String, String> header : response.getHeaders().entries()) {
 output.printf("< %s: %s\n", header.getKey(), header.getValue());

代码示例来源:origin: co.cask.cdap/cdap-cli

for (Map.Entry<String, String> header : response.getHeaders().entries()) {
 output.printf("< %s: %s\n", header.getKey(), header.getValue());

相关文章