0

I am trying to consume a Springboot File upload api, that takes in a MultipartFile... via RESTeasy with packages resteasy-client:3.9.1.final && resteasy-multipart-provider:3.9.1.final.

However i am failing to get the implementation right. Any Suggestions

Here's an example of how the code looks like

`WebTarget target = ClientBuilder.newClient().target("url"); MultipartFormDataOutput formData = new MultipartFormDataOutput(); byte[] fileContent = request.getContent().getBytes[];

formData.addFormData("image", new ByteArrayInputStream(fileContent), MediaType.APPLICATION_OCTET_STREAM_TYPE); Entity entity = Entity.entity(formData, MediaType.MULTIPART_FORM_DATA); Response response = target.request().post(entity);`

Musa Baloyi
  • 428
  • 2
  • 4
  • 10

0 Answers0