diff --git a/modules/ROOT/pages/send-receive-multipart-jaxrs.adoc b/modules/ROOT/pages/send-receive-multipart-jaxrs.adoc index 3f725d79a..4a93a4991 100644 --- a/modules/ROOT/pages/send-receive-multipart-jaxrs.adoc +++ b/modules/ROOT/pages/send-receive-multipart-jaxrs.adoc @@ -45,63 +45,6 @@ buildscript { } ---- -[#multipart] -== Processing multipart data - -The `multipart/form-data` media type enables requests to send multiple entities (parts) as a single entity using `jakarta.ws.rs.core.EntityPart` objects. - -For example, MicroProfile Multipart Rest Clients are defined as Java interfaces. - -[source,java] ----- -@Consumes(MediaType.MULTIPART_FORM_DATA) -@Produces(MediaType.MULTIPART_FORM_DATA) -@Path("/test-app") -public interface MultiPartClient extends AutoCloseable { - - @POST - @Path("upload/") - void uploadFile(List entityParts) throws IOException; -} ----- - -The example code utilizing this ingerface - -source,java] ----- -public void uploadMultipleFiles() throws Exception { - try (MultiPartClient client = RestClientBuilder.newBuilder() - .baseUri(uri) - .build(MultiPartClient.class)) { - final Map entityPartContent = new LinkedHashMap<>(2); - try (InputStream in = MultiPartClientTest.class - .getResourceAsStream("/multipart/test-file1.txt")) { - entityPartContent.put("test-file1.txt", in.readAllBytes()); - } - try (InputStream in = MultiPartClientTest.class - .getResourceAsStream("/multipart/test-file2.txt")) { - entityPartContent.put("test-file2.txt", in.readAllBytes()); - } - final List files = entityPartContent.entrySet() - .stream() - .map((entry) -> { - try { - return EntityPart.withName(entry.getKey()) - .fileName(entry.getKey()) - .content(entry.getValue()) - .mediaType(MediaType.APPLICATION_OCTET_STREAM_TYPE) - .build(); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - }) - .collect(Collectors.toList()); - client.uploadFile(files); - - } - } ----- - == Send multipart/form-data parts from Jakarta Restful Web Services resources diff --git a/modules/reference/pages/diff/mp-61-70-diff.adoc b/modules/reference/pages/diff/mp-61-70-diff.adoc index 9cbf38bff..ac1f480b7 100644 --- a/modules/reference/pages/diff/mp-61-70-diff.adoc +++ b/modules/reference/pages/diff/mp-61-70-diff.adoc @@ -90,7 +90,7 @@ RestClientBuilder.newBuilder() === Processing multipart data -Information and example code are added to the xref:ROOT:send-receive-multipart-jaxrs.adoc#multipart[send and receive multipart/form-data parts in Jakarta Restful Web Services] for processing multipart data, introduced as part of RESTful Web Services version 3.1 in EE10. +The link:https://download.eclipse.org/microprofile/microprofile-rest-client-4.0/microprofile-rest-client-spec-4.0.html#_processing_multipart_data[MicroProfile Rest Client 4.0 specification] includes information and example code for processing multipart data, introduced as part of RESTful Web Services version 3.1 in EE10. [#openapi]