當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpHeaders.setAll方法代碼示例

本文整理匯總了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;

}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:12,代碼來源:SimpleHttpRequester.java

示例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;
}
 
開發者ID:kanjielu,項目名稱:jeeves,代碼行數:14,代碼來源:HeaderUtils.java

示例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());
    }
}
 
開發者ID:kanjielu,項目名稱:jeeves,代碼行數:15,代碼來源:HeaderUtils.java

示例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());
}
 
開發者ID:xienjiang,項目名稱:session-cloud,代碼行數:14,代碼來源:CustomOauthResponseExceptionTranslator.java


注:本文中的org.springframework.http.HttpHeaders.setAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。