public interface GroovyByContentSpec extends ByContentSpec
ByContentSpec
.Modifier and Type | Method and Description |
---|---|
GroovyByContentSpec |
html(Closure<?> closure)
Specifies that the given action should be used if the client wants content of type "text/html".
|
GroovyByContentSpec |
json(Closure<?> closure)
Specifies that the given action should be used if the client wants content of type "application/json".
|
GroovyByContentSpec |
noMatch(Closure<?> closure)
Specifies that the given action should be used if the client's requested content type cannot be matched with any of the other handlers.
|
GroovyByContentSpec |
plainText(Closure<?> closure)
Specifies that the given action should be used if the client wants content of type "text/plain".
|
GroovyByContentSpec |
type(String mimeType,
Closure<?> closure)
Specifies that the given action should be used if the client wants content of the given MIME type.
|
GroovyByContentSpec |
xml(Closure<?> closure)
Specifies that the given action should be used if the client wants content of type "application/xml".
|
GroovyByContentSpec type(String mimeType, @DelegatesTo(value=GroovyContext.class) Closure<?> closure)
mimeType
- The MIME type to register forclosure
- The action to take if the content type matchesGroovyByContentSpec plainText(@DelegatesTo(value=GroovyContext.class) Closure<?> closure)
closure
- The action to take if the content type matchesGroovyByContentSpec html(@DelegatesTo(value=GroovyContext.class) Closure<?> closure)
closure
- The action to take if the content type matchesGroovyByContentSpec json(@DelegatesTo(value=GroovyContext.class) Closure<?> closure)
closure
- The action to take if the content type matchesGroovyByContentSpec xml(@DelegatesTo(value=GroovyContext.class) Closure<?> closure)
closure
- The action to take if the content type matchesGroovyByContentSpec noMatch(@DelegatesTo(value=GroovyContext.class) Closure<?> closure)
closure
- The action to invoke if the content type doesn't match