本文整理了Java中com.google.api.client.http.HttpRequest.getResponseHeaders()
方法的一些代码示例,展示了HttpRequest.getResponseHeaders()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpRequest.getResponseHeaders()
方法的具体详情如下:
包路径:com.google.api.client.http.HttpRequest
类名称: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) -> {
内容来源于网络,如有侵权,请联系作者删除!