public interface 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 from
org.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() method has to be invoked before reading from the
InputStream obtained from the
but they must NOT require that the
InputStream has to be read
from before the
head() method invocation.
All implementations of this interface must be immutable and thread-safe.
RsWithHeader, Composable Decorators vs. Imperative Utility Methods
Copyright © 2015–2018 Take. All rights reserved.