Dropwizard Forms

The dropwizard-forms module provides you with a support for multi-part forms via Jersey.

Adding The Bundle

Then, in your application’s initialize method, add a new MultiPartBundle subclass:

public void initialize(Bootstrap<ExampleConfiguration> bootstrap) {
    bootstrap.addBundle(new MultiPartBundle());


To test resources that utilize multi-part form features, one must add MultiPartFeature.class to the ResourceExtension as a provider, and register it on the client like the following:

public class MultiPartTest {

    public static final ResourceExtension resourceExtension = ResourceExtension.builder()
            .addResource(new TestResource())

    public void testClientMultipart() {
        final FormDataMultiPart multiPart = new FormDataMultiPart()
                .field("test-data", "Hello Multipart");
        final String response = resourceExtension.target("/test")
                .post(Entity.entity(multiPart, multiPart.getMediaType()), String.class);
        assertThat(response).isEqualTo("Hello Multipart");

    public static class TestResource {
        public String post(@FormDataParam("test-data") String testData) {
            return testData;

More Information

For additional and more detailed documentation about the Jersey multi-part support, please refer to the documentation in the Jersey User Guide and Javadoc.