From: John U. <uj...@gm...> - 2017-02-20 14:17:31
|
Hi all, how can I make a multipart/form-data POST with the JAX-RS Client API and RESTEasy 3? With RESTEasy 2, I used the client proxy framework <http://docs.jboss.org/resteasy/docs/2.3.7.Final/userguide/html/RESTEasy_Client_Framework.html> with an interface method like this: @POST @Path("/path/...") @Consumes("multipart/form-data") @Produces("application/json") ClientResponse<MyResponse> myRequest(@PartType(MediaType.APPLICATION_OCTET_STREAM) Map<String, javax.activation.DataSource> parts); With RESTEasy 3, I'm switching to the official JAX-RS Client API. I tried to start with something like this: Map<String, javax.activation.DataSource> parts = ...; client.target("/path/...").request().accept(APPLICATION_JSON_TYPE).post(Entity.entity(parts, MULTIPART_FORM_DATA_TYPE)); But it gives me: Caused by: javax.ws.rs.ProcessingException: RESTEASY003215: could not find writer for content-type multipart/form-data type: java.util.HashMap at org.jboss.resteasy.core.interception.ClientWriterInterceptorContext.throwWriterNotFoundException(ClientWriterInterceptorContext.java:40) ... Thanks, John |