本文整理匯總了Java中org.springframework.http.HttpHeaders.readOnlyHttpHeaders方法的典型用法代碼示例。如果您正苦於以下問題:Java HttpHeaders.readOnlyHttpHeaders方法的具體用法?Java HttpHeaders.readOnlyHttpHeaders怎麽用?Java HttpHeaders.readOnlyHttpHeaders使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.http.HttpHeaders
的用法示例。
在下文中一共展示了HttpHeaders.readOnlyHttpHeaders方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: headers_withReadOnlyHttpHeaders
import org.springframework.http.HttpHeaders; //導入方法依賴的package包/類
@Test
public void headers_withReadOnlyHttpHeaders() {
HttpHeaders httpHeaders = HttpHeaders.readOnlyHttpHeaders(new HttpHeaders());
DefaultRequest defaultRequest = new DefaultRequest(new DefaultUriBuilderFactory().builder(),
HttpMethod.GET, httpHeaders, new HashMap<>(), BodyInserters.empty());
defaultRequest.headers().add(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE);
assertThat(defaultRequest.headers().getFirst(HttpHeaders.ACCEPT)).isEqualTo(MediaType.APPLICATION_JSON_VALUE);
}
示例2: getHeaders
import org.springframework.http.HttpHeaders; //導入方法依賴的package包/類
@Override
public final HttpHeaders getHeaders() {
return (this.executed ? HttpHeaders.readOnlyHttpHeaders(this.headers) : this.headers);
}
示例3: getHeaders
import org.springframework.http.HttpHeaders; //導入方法依賴的package包/類
@Override
public HttpHeaders getHeaders() {
return (this.headersWritten ? HttpHeaders.readOnlyHttpHeaders(this.headers) : this.headers);
}
示例4: getHeaders
import org.springframework.http.HttpHeaders; //導入方法依賴的package包/類
@Override
public HttpHeaders getHeaders() {
return this.headersWritten ? HttpHeaders.readOnlyHttpHeaders(this.headers) : this.headers;
}
示例5: getHeaders
import org.springframework.http.HttpHeaders; //導入方法依賴的package包/類
@Override
public HttpHeaders getHeaders() {
return headersWritten ? HttpHeaders.readOnlyHttpHeaders(headers) : this.headers;
}