接口 RequestEntity.BodyBuilder
- 封闭类:
- RequestEntity<T>
public static interface RequestEntity.BodyBuilder extends RequestEntity.HeadersBuilder<RequestEntity.BodyBuilder>
Defines a builder that adds a body to the response entity.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 <T> RequestEntity<T>body(T body)Set the body of the request entity and build the RequestEntity.<T> RequestEntity<T>body(T body, Type type)Set the body and type of the request entity and build the RequestEntity.RequestEntity.BodyBuildercontentLength(long contentLength)Set the length of the body in bytes, as specified by theContent-Lengthheader.RequestEntity.BodyBuildercontentType(MediaType contentType)Set the media type of the body, as specified by theContent-Typeheader.从接口继承的方法 org.springframework.http.RequestEntity.HeadersBuilder
accept, acceptCharset, build, header, headers, headers, ifModifiedSince, ifModifiedSince, ifModifiedSince, ifNoneMatch
方法详细资料
contentLength
RequestEntity.BodyBuilder contentLength(long contentLength)
Set the length of the body in bytes, as specified by theContent-Lengthheader.- 参数:
contentLength- the content length- 返回:
- this builder
- 另请参阅:
HttpHeaders.setContentLength(long)
contentType
RequestEntity.BodyBuilder contentType(MediaType contentType)
Set the media type of the body, as specified by theContent-Typeheader.- 参数:
contentType- the content type- 返回:
- this builder
- 另请参阅:
HttpHeaders.setContentType(MediaType)
body
<T> RequestEntity<T> body(T body)
Set the body of the request entity and build the RequestEntity.- 类型参数:
T- the type of the body- 参数:
body- the body of the request entity- 返回:
- the built request entity
body
<T> RequestEntity<T> body(T body, Type type)
Set the body and type of the request entity and build the RequestEntity.- 类型参数:
T- the type of the body- 参数:
body- the body of the request entitytype- the type of the body, useful for generic type resolution- 返回:
- the built request entity
- 从以下版本开始:
- 4.3