In Jakarta RESTful Web Services 3.1 the SeBootstrap
API was
introduced as well as the EntityPart
API for multipart data. This example shows how to use these API’s with RESTEasy.
To build the standalone-multipart
quickstart you must have Maven installed and at least
Java 11. Then you simply need to run the following:
mvn clean verify
This will create a standalone-multipart.jar
which can be executed from the command line. A test is also executed as
part of the build.
The standalone-multipart.jar
created can be executed from the command.
java -jar target/standalone-multipart.jar
This will start an Undertow container with RESTEasy and CDI support. Then make a multipart/form-data request and print the results of the request. You should end up seeing something like:
Container running at http://localhost:8081/ OK {"name":"RESTEasy","data":"test content","entity":"entity-part"} ---