public interface ByContentSpec
Context.byContent(ratpack.func.Action)
Modifier and Type | Method and Description |
---|---|
ByContentSpec |
html(Handler handler)
Specifies that the given handler should be used if the client wants content of type "text/html".
|
ByContentSpec |
json(Handler handler)
Specifies that the given handler should be used if the client wants content of type "application/json".
|
ByContentSpec |
plainText(Handler handler)
Specifies that the given handler should be used if the client wants content of type "text/plain".
|
ByContentSpec |
type(String mimeType,
Handler handler)
Specifies that the given handler should be used if the client wants content of the given mime type.
|
ByContentSpec |
xml(Handler handler)
Specifies that the given handler should be used if the client wants content of type "application/xml".
|
ByContentSpec type(String mimeType, Handler handler)
mimeType
- The mime type to register forhandler
- The handler to invoke if the content type matchesByContentSpec plainText(Handler handler)
handler
- The handler to invoke if the content type matchesByContentSpec html(Handler handler)
handler
- The handler to invoke if the content type matchesByContentSpec json(Handler handler)
handler
- The handler to invoke if the content type matchesByContentSpec xml(Handler handler)
handler
- The handler to invoke if the content type matches