Package ratpack.core.handling
Interface ByMethodSpec
-
- All Known Subinterfaces:
GroovyByMethodSpec
public interface ByMethodSpec
A specification of how to respond to a request, based on the requested method.- See Also:
Context.byMethod(Action)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ByMethodSpec
delete(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of DELETE.ByMethodSpec
delete(Handler handler)
Inserts the handler to chain if the request has a HTTP method of DELETE.ByMethodSpec
delete(Block block)
Defines the action to to take if the request has a HTTP method of DELETE.ByMethodSpec
get(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of GET.ByMethodSpec
get(Handler handler)
Inserts the handler to chain if the request has a HTTP method of GET.ByMethodSpec
get(Block block)
Defines the action to to take if the request has a HTTP method of GET.ByMethodSpec
named(String methodName, Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method ofmethodName
.ByMethodSpec
named(String methodName, Handler handler)
Inserts the handler to chain if the request has a HTTP method ofmethodName
.ByMethodSpec
named(String methodName, Block block)
Defines the action to to take if the request has a HTTP method ofmethodName
.ByMethodSpec
options(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of OPTIONS.ByMethodSpec
options(Handler handler)
Inserts the handler to chain if the request has a HTTP method of OPTIONS.ByMethodSpec
options(Block block)
Defines the action to to take if the request has a HTTP method of OPTIONS.ByMethodSpec
patch(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of PATCH.ByMethodSpec
patch(Handler handler)
Inserts the handler to chain if the request has a HTTP method of PATCH.ByMethodSpec
patch(Block block)
Defines the action to to take if the request has a HTTP method of PATCH.ByMethodSpec
post(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of POST.ByMethodSpec
post(Handler handler)
Inserts the handler to chain if the request has a HTTP method of POST.ByMethodSpec
post(Block block)
Defines the action to to take if the request has a HTTP method of POST.ByMethodSpec
put(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of PUT.ByMethodSpec
put(Handler handler)
Inserts the handler to chain if the request has a HTTP method of PUT.ByMethodSpec
put(Block block)
Defines the action to to take if the request has a HTTP method of PUT.
-
-
-
Method Detail
-
get
ByMethodSpec get(Block block)
Defines the action to to take if the request has a HTTP method of GET.- Parameters:
block
- the code to invoke if the request method matches- Returns:
- this
-
get
ByMethodSpec get(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of GET.- Parameters:
clazz
- a handler class- Returns:
- this
- Since:
- 1.5
-
get
ByMethodSpec get(Handler handler)
Inserts the handler to chain if the request has a HTTP method of GET.- Parameters:
handler
- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
post
ByMethodSpec post(Block block)
Defines the action to to take if the request has a HTTP method of POST.- Parameters:
block
- the code to invoke if the request method matches- Returns:
- this
-
post
ByMethodSpec post(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of POST.- Parameters:
clazz
- a handler class- Returns:
- this
- Since:
- 1.5
-
post
ByMethodSpec post(Handler handler)
Inserts the handler to chain if the request has a HTTP method of POST.- Parameters:
handler
- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
put
ByMethodSpec put(Block block)
Defines the action to to take if the request has a HTTP method of PUT.- Parameters:
block
- the code to invoke if the request method matches- Returns:
- this
-
put
ByMethodSpec put(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of PUT.- Parameters:
clazz
- a handler class- Returns:
- this
- Since:
- 1.5
-
put
ByMethodSpec put(Handler handler)
Inserts the handler to chain if the request has a HTTP method of PUT.- Parameters:
handler
- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
patch
ByMethodSpec patch(Block block)
Defines the action to to take if the request has a HTTP method of PATCH.- Parameters:
block
- the code to invoke if the request method matches- Returns:
- this
-
patch
ByMethodSpec patch(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of PATCH.- Parameters:
clazz
- a handler class- Returns:
- this
- Since:
- 1.5
-
patch
ByMethodSpec patch(Handler handler)
Inserts the handler to chain if the request has a HTTP method of PATCH.- Parameters:
handler
- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
options
ByMethodSpec options(Block block)
Defines the action to to take if the request has a HTTP method of OPTIONS.- Parameters:
block
- the code to invoke if the request method matches- Returns:
- this
- Since:
- 1.1
-
options
ByMethodSpec options(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of OPTIONS.- Parameters:
clazz
- a handler class- Returns:
- this
- Since:
- 1.5
-
options
ByMethodSpec options(Handler handler)
Inserts the handler to chain if the request has a HTTP method of OPTIONS.- Parameters:
handler
- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
delete
ByMethodSpec delete(Block block)
Defines the action to to take if the request has a HTTP method of DELETE.- Parameters:
block
- the code to invoke if the request method matches- Returns:
- this
-
delete
ByMethodSpec delete(Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of DELETE.- Parameters:
clazz
- a handler class- Returns:
- this
- Since:
- 1.5
-
delete
ByMethodSpec delete(Handler handler)
Inserts the handler to chain if the request has a HTTP method of DELETE.- Parameters:
handler
- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
named
ByMethodSpec named(String methodName, Block block)
Defines the action to to take if the request has a HTTP method ofmethodName
.The method name is case insensitive.
- Parameters:
methodName
- The HTTP method to map the given action toblock
- the code to invoke if the request method matches- Returns:
- this
-
named
ByMethodSpec named(String methodName, Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method ofmethodName
.The method name is case insensitive.
- Parameters:
methodName
- The HTTP method to map the given action toclazz
- a handler class- Returns:
- this
- Since:
- 1.5
-
named
ByMethodSpec named(String methodName, Handler handler)
Inserts the handler to chain if the request has a HTTP method ofmethodName
.The method name is case insensitive.
- Parameters:
methodName
- The HTTP method to map the given action tohandler
- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
-