本文整理汇总了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;
}