public interface ResponseMetaData
Allows access to modifying the response properties and registering actions to finalize the response and are executed before sending the response.
Modifier and Type | Method and Description |
---|---|
ResponseMetaData |
contentType(CharSequence contentType)
Sets the response
Content-Type header. |
ResponseMetaData |
contentTypeIfNotSet(CharSequence contentType)
Sets the response
Content-Type header, if it has not already been set. |
Cookie |
cookie(String name,
String value)
Creates a new cookie with the given name and value.
|
Cookie |
expireCookie(String name)
Adds a cookie to the response with a 0 max-age, forcing the client to expire it.
|
Set<Cookie> |
getCookies()
The cookies that are to be part of the response.
|
MutableHeaders |
getHeaders()
The response headers.
|
Status |
getStatus()
The status that will be part of the response when sent.
|
ResponseMetaData |
noCompress() |
ResponseMetaData |
status(int code)
Sets the status line of the response.
|
ResponseMetaData |
status(Status status)
Sets the status line of the response.
|
Status getStatus()
By default, this will return a "200 OK"
response.
status(int)
ResponseMetaData status(int code)
The message used will be the standard for the code.
code
- The status code of the response to use when it is sent.ResponseMetaData status(Status status)
status
- The status of the response to use when it is sent.MutableHeaders getHeaders()
ResponseMetaData contentType(CharSequence contentType)
Content-Type
header.contentType
- The value of the Content-Type
headerResponseMetaData contentTypeIfNotSet(CharSequence contentType)
Content-Type
header, if it has not already been set.contentType
- The value of the Content-Type
headerSet<Cookie> getCookies()
The cookies are mutable.
Cookie cookie(String name, String value)
The cookie will have no expiry. Use the returned cookie object to fine tune the cookie.
name
- The name of the cookievalue
- The value of the cookieCookie expireCookie(String name)
name
- The name of the cookie to expire.ResponseMetaData noCompress()