public interface Resp
| Modifier and Type | Method and Description |
|---|---|
Resp |
binary(Object content)
Sets the
Content-Type: application/octet-stream header and the content of the HTTP response. |
Object |
body()
Gets the raw body data that is copied into the HTTP response body when it is rendered.
|
Resp |
body(byte[] body)
Sets the raw body data as
byte[] that is copied into the HTTP response body when it is
rendered. |
Resp |
body(ByteBuffer body)
Sets the raw body data as
ByteBuffer that is copied into the HTTP response body when it is
rendered. |
int |
code()
Gets the status code (e.g.
|
Resp |
code(int code)
Sets the status code (e.g.
|
Object |
content()
Gets the content to be serialized into a body when the HTTP response is rendered.
|
Resp |
content(Object content)
Sets the content to be serialized into a body when the HTTP response is rendered.
|
MediaType |
contentType()
Gets the
Content-Type header to be rendered in the HTTP response. |
Resp |
contentType(MediaType contentType)
Sets the
Content-Type header to be rendered in the HTTP response. |
Map<String,String> |
cookies()
Provides read/write access to the cookies of the HTTP response.
|
Req |
done()
Informs the HTTP server that the asynchronous handling has finished and the response is complete.
Alias to request().done(). |
File |
file()
Gets the file to be served when the HTTP response is rendered.
|
Resp |
file(File file)
Sets the file to be served when the HTTP response is rendered.
|
String |
filename()
Gets the filename when serving a file in the HTTP response.
|
Resp |
filename(String filename)
Sets the filename when serving a file in the HTTP response.
|
Map<String,String> |
headers()
Provides read/write access to the headers of the HTTP response.
|
Resp |
html(Object content)
Sets the
Content-Type: text/html; charset=utf-8 header and the content of the HTTP response. |
Resp |
json(Object content)
Sets the
Content-Type: application/json; charset=utf-8 header and the content of the HTTP
response. |
Resp |
plain(Object content)
Sets the
Content-Type: text/plain; charset=utf-8 header and the content of the HTTP response. |
String |
redirect()
Gets the redirect URI of the HTTP response.
|
Resp |
redirect(String redirectURI)
Sets the redirect URI of the HTTP response.
|
Req |
request()
Gets the reference to the request object.
|
String |
view()
Gets a custom view name of the HTTP response.
|
Resp |
view(String viewName)
Sets a custom view name of the HTTP response.
|
Resp content(Object content)
Object content()
Resp body(byte[] body)
byte[] that is copied into the HTTP response body when it is
rendered.Resp body(ByteBuffer body)
ByteBuffer that is copied into the HTTP response body when it is
rendered.Object body()
Resp code(int code)
int code()
Resp contentType(MediaType contentType)
Content-Type header to be rendered in the HTTP response.MediaType contentType()
Content-Type header to be rendered in the HTTP response.Resp redirect(String redirectURI)
String redirect()
String filename()
String view()
File file()
Map<String,String> headers()
Map<String,String> cookies()
Req done()
request().done().Resp plain(Object content)
Content-Type: text/plain; charset=utf-8 header and the content of the HTTP response. contentType(MediaType.PLAIN_TEXT_UTF_8).body(content).Resp html(Object content)
Content-Type: text/html; charset=utf-8 header and the content of the HTTP response. contentType(MediaType.HTML_UTF_8).body(content).Resp json(Object content)
Content-Type: application/json; charset=utf-8 header and the content of the HTTP
response. contentType(MediaType.JSON_UTF_8).body(content).Resp binary(Object content)
Content-Type: application/octet-stream header and the content of the HTTP response. contentType(MediaType.BINARY).body(content).Req request()
Copyright © 2014–2015 Nikolche Mihajlovski and contributors. All rights reserved.