Package io.dropwizard.servlets.tasks
Class PostBodyTask
java.lang.Object
io.dropwizard.servlets.tasks.Task
io.dropwizard.servlets.tasks.PostBodyTask
- Direct Known Subclasses:
EchoTask
A task which can be performed via the admin interface and provides the post body of the request.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PostBodyTask
(String name) Create a new task with the given name.protected
PostBodyTask
(String name, String responseContentType) Create a new task with the given name and response content type -
Method Summary
Methods inherited from class io.dropwizard.servlets.tasks.Task
getName, getResponseContentType
-
Constructor Details
-
PostBodyTask
Create a new task with the given name.- Parameters:
name
- the task's name
-
PostBodyTask
Create a new task with the given name and response content type- Parameters:
name
- the task's nameresponseContentType
- the task's response content type- Since:
- 2.0
-
-
Method Details
-
execute
public abstract void execute(Map<String, List<String>> parameters, String body, PrintWriter output) throws Exception- Parameters:
parameters
- the query string parametersbody
- the plain text request bodyoutput
- aPrintWriter
wrapping the output stream of the task- Throws:
Exception
-
execute
@Deprecated public void execute(Map<String, List<String>> parameters, PrintWriter output) throws ExceptionDeprecated.Useexecute(Map, String, PrintWriter)
or inherit from Task instead.Deprecated, useexecute(Map, String, PrintWriter)
or inherit from Task instead.- Specified by:
execute
in classTask
- Parameters:
parameters
- the query string parametersoutput
- aPrintWriter
wrapping the output stream of the task- Throws:
Exception
-
execute(Map, String, PrintWriter)
or inherit from Task instead.