- All Superinterfaces:
BaseResponse
- All Known Subinterfaces:
WebResponse
Represents a server response in a server exchange.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbody()
Returns the response body used to produce response payload.int
Returns the number of bytes transfered as part of the response body.headers
(Consumer<OutboundResponseHeaders> headersConfigurer) Configures the HTTP headers to send in the response.boolean
Determines whether the response headers have been sent to the client.Sends an interim 100 continue response to the client so it can send the rest of the request.trailers
(Consumer<OutboundHeaders<?>> trailersConfigurer) Configures the HTTP trailers to send in the response.Methods inherited from interface io.inverno.mod.http.base.BaseResponse
headers, trailers
-
Method Details
-
isHeadersWritten
boolean isHeadersWritten()Determines whether the response headers have been sent to the client.
Any attempts to specify new headers in the response, once headers have been sent to the client, will result in an
IllegalStateException
being thrown.- Returns:
- true if headers have been sent, false otherwise
-
getTransferedLength
int getTransferedLength()Returns the number of bytes transfered as part of the response body.
- Returns:
- the transfered length
-
headers
Configures the HTTP headers to send in the response.
- Parameters:
headersConfigurer
- a response headers configurer- Returns:
- the response
- Throws:
IllegalStateException
- if response headers have already been sent to the client
-
trailers
Configures the HTTP trailers to send in the response.
- Parameters:
trailersConfigurer
- a response trailers configurer- Returns:
- the response
-
sendContinue
Sends an interim 100 continue response to the client so it can send the rest of the request.
This method should only be used when the request contains header
expect: 100-continue
.- Returns:
- the response
- Throws:
IllegalStateException
- if response headers have already been sent to the client
-
body
ResponseBody body()Returns the response body used to produce response payload.
- Returns:
- a response body
-