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" );
All implementations of this interface must be immutable and thread-safe.
Take
,
RsWithBody
,
RsWithHeader
Modifier and Type | Method and Description |
---|---|
InputStream |
body()
HTTP response body.
|
Iterable<String> |
head()
HTTP response head.
|
Iterable<String> head() throws IOException
IOException
- If something goes wrongInputStream body() throws IOException
IOException
- If something goes wrongCopyright © 2015 Take. All rights reserved.