rescu icon indicating copy to clipboard operation
rescu copied to clipboard

What is the best practice to consume MULTIPART_FORM_DATA

Open sutra opened this issue 4 years ago • 3 comments

Like this:

@POST
@Path("/upload")
@Consumes(MediaType.MULTIPART_FORM_DATA)
void updateFile(File file) throws IOException;
java.lang.IllegalArgumentException: Unsupported media type: multipart/form-data
	at si.mazi.rescu.RequestWriterResolver.resolveWriter(RequestWriterResolver.java:57)

See https://github.com/go-resty/resty#multipart-files-upload as well.

sutra avatar Jan 21 '21 16:01 sutra

rescu doesn't currently support accessing multipart/form-data services and there is no such support planned.

If you wish to implement this in rescu, we can discuss how to best do this.

mmazi avatar Jan 26 '21 09:01 mmazi

Maybe expose the RequestWriterResolver to let user add their own RequestWriter.

sutra avatar Jan 26 '21 11:01 sutra

Seems doable. If you submit a pull request, I'll be happy to review it.

mmazi avatar Jan 27 '21 11:01 mmazi