Package org.takes
Interface Response
-
- All Known Implementing Classes:
ResponseOf
,RsBuffered
,RsEmpty
,RsFailure
,RsFlash
,RsFluent
,RsFork
,RsForward
,RsGzip
,RsHeaders.Base
,RsHeaders.Smart
,RsHtml
,RsJson
,RsLogout
,RsPrettyJson
,RsPrettyXml
,RsPrevious
,RsPrint
,RsRedirect
,RsReturn
,RsSimple
,RsStatus.Base
,RsText
,RsVelocity
,RsWithBody
,RsWithCookie
,RsWithHeader
,RsWithHeaders
,RsWithoutHeader
,RsWithStatus
,RsWithType
,RsWithType.Html
,RsWithType.Json
,RsWithType.Text
,RsWithType.Xml
,RsWrap
,RsXembly
,RsXslt
public interface Response extends Head, Body
HTTP response.Response
interface is an abstraction of a HTTP response, that consists of a few headers and a body. To construct a response, use one of the composable decorators fromorg.takes.rs
package. For example, this code will create a response with HTML inside:final Response response = new RsWithHeader( new RsWithBody( new RsWithStatus(200), "hello, world!" ), "Content-Type", "text/html" );
The implementations of this interface may require that
Head.head()
method has to be invoked before reading from theInputStream
obtained from theBody.body()
method, but they must NOT require that theInputStream
has to be read from before theHead.head()
method invocation.All implementations of this interface must be immutable and thread-safe.
- Since:
- 0.1
- See Also:
Take
,RsWithBody
,RsWithHeader
, Composable Decorators vs. Imperative Utility Methods