本文整理汇总了Java中org.springframework.http.HttpHeaders.setAll方法的典型用法代码示例。如果您正苦于以下问题:Java HttpHeaders.setAll方法的具体用法?Java HttpHeaders.setAll怎么用?Java HttpHeaders.setAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.http.HttpHeaders
的用法示例。
在下文中一共展示了HttpHeaders.setAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRequestEntity
import org.springframework.http.HttpHeaders; //导入方法依赖的package包/类
protected HttpEntity<?> getRequestEntity() {
HttpHeaders requestHeaders = new HttpHeaders();
if (this.securityProperties != null) {
requestHeaders.setAll(securityProperties);
}
HttpEntity<?> requestEntity = new HttpEntity(requestHeaders);
return requestEntity;
}
示例2: merge
import org.springframework.http.HttpHeaders; //导入方法依赖的package包/类
public static HttpHeaders merge(HttpHeaders... headers) {
if (headers == null) {
throw new IllegalArgumentException("headers");
}
if (headers.length == 1) {
return headers[0];
}
HttpHeaders header = new HttpHeaders();
for (HttpHeaders h : headers) {
header.setAll(h.toSingleValueMap());
}
return header;
}
示例3: assign
import org.springframework.http.HttpHeaders; //导入方法依赖的package包/类
public static void assign(HttpHeaders header, HttpHeaders... headers) {
if (header == null) {
throw new IllegalArgumentException("header");
}
if (headers == null) {
throw new IllegalArgumentException("headers");
}
if (headers.length == 0) {
return;
}
for (HttpHeaders h : headers) {
header.setAll(h.toSingleValueMap());
}
}
示例4: translate
import org.springframework.http.HttpHeaders; //导入方法依赖的package包/类
@Override
public ResponseEntity<OAuth2Exception> translate(Exception e)
throws Exception {
ResponseEntity<OAuth2Exception> responseEntity = super.translate(e);
OAuth2Exception body = responseEntity.getBody();
HttpHeaders headers = new HttpHeaders();
headers.setAll(responseEntity.getHeaders().toSingleValueMap());
// do something with header or response
return new ResponseEntity<>(body, headers, responseEntity.getStatusCode());
}