public static interface ResponseEntity.BodyBuilder extends ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>
Modifier and Type | Method and Description |
---|---|
<T> ResponseEntity<T> |
body(T body)
Set the body of the response entity and returns it.
|
ResponseEntity.BodyBuilder |
contentLength(long contentLength)
Set the length of the body in bytes, as specified by the
Content-Length header. |
ResponseEntity.BodyBuilder |
contentType(MediaType contentType)
Set the media type of the body, as specified by the
Content-Type header. |
allow, build, cacheControl, eTag, header, headers, lastModified, location, varyBy
ResponseEntity.BodyBuilder contentLength(long contentLength)
Content-Length
header.contentLength
- the content lengthHttpHeaders.setContentLength(long)
ResponseEntity.BodyBuilder contentType(MediaType contentType)
Content-Type
header.contentType
- the content typeHttpHeaders.setContentType(MediaType)
<T> ResponseEntity<T> body(T body)
T
- the type of the bodybody
- the body of the response entity