Package org.springframework.http
Interface ResponseEntity.BodyBuilder
- All Superinterfaces:
- ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>
- Enclosing class:
- ResponseEntity<T>
public static interface ResponseEntity.BodyBuilder
extends ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>
Defines a builder that adds a body to the response entity.
- Since:
- 4.1
- 
Method SummaryModifier and TypeMethodDescription<T> ResponseEntity<T>Set the body of the response entity and returns it.contentLength(long contentLength) Set the length of the body in bytes, as specified by theContent-Lengthheader.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader.Methods inherited from interface org.springframework.http.ResponseEntity.HeadersBuilderallow, build, cacheControl, eTag, header, headers, headers, lastModified, lastModified, lastModified, location, varyBy
- 
Method Details- 
contentLengthSet the length of the body in bytes, as specified by theContent-Lengthheader.- Parameters:
- contentLength- the content length
- Returns:
- this builder
- See Also:
 
- 
contentTypeSet the media type of the body, as specified by theContent-Typeheader.- Parameters:
- contentType- the content type
- Returns:
- this builder
- See Also:
 
- 
bodySet the body of the response entity and returns it.- Type Parameters:
- T- the type of the body
- Parameters:
- body- the body of the response entity
- Returns:
- the built response entity
 
 
-