com.google.api.client.http.HttpRequest.getResponseHeaders()方法的使用及代码示例

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

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

HttpRequest.getResponseHeaders介绍

暂无

代码示例

代码示例来源:origin: googleads/googleads-java-lib

@VisibleForTesting
ResponseInfo buildResponseInfo(HttpRequest request, int statusCode, String statusMessage) {
 ResponseInfo.Builder responseBuilder = new ResponseInfo.Builder();
 // Include all response headers + the redacted token for the response body.
 StringBuilder payloadBuilder = new StringBuilder();
 payloadBuilder.append(String.format("%d %s%n", statusCode, statusMessage));
 appendMapAsString(payloadBuilder, request.getResponseHeaders());
 payloadBuilder.append(String.format("%nContent:%n%s", REDACTED_REPORT_DATA));
 return responseBuilder.withPayload(payloadBuilder.toString()).build();
}

代码示例来源:origin: com.google.api-ads/ads-lib

@VisibleForTesting
ResponseInfo buildResponseInfo(HttpRequest request, int statusCode, String statusMessage) {
 ResponseInfo.Builder responseBuilder = new ResponseInfo.Builder();
 // Include all response headers + the redacted token for the response body.
 StringBuilder payloadBuilder = new StringBuilder();
 payloadBuilder.append(String.format("%d %s%n", statusCode, statusMessage));
 appendMapAsString(payloadBuilder, request.getResponseHeaders());
 payloadBuilder.append(String.format("%nContent:%n%s", REDACTED_REPORT_DATA));
 return responseBuilder.withPayload(payloadBuilder.toString()).build();
}

代码示例来源:origin: googleads/googleads-java-lib

httpRequest.getResponseHeaders().setContentType("text/csv; charset=UTF-8");
httpRequest.getResponseHeaders().put("someOtherResponseHeader", "foo");
httpRequest
  .getResponseHeaders()
  .put("multiValueHeader", Arrays.<String>asList("value1", "value2"));

代码示例来源:origin: googleads/googleads-java-lib

String responsePayloadLower = responseInfo.getPayload().toLowerCase();
httpRequest
  .getResponseHeaders()
  .forEach(
    (key, value) -> {

相关文章