Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fedotxxl/a96b2562da2350bba7e2 to your computer and use it in GitHub Desktop.
Save fedotxxl/a96b2562da2350bba7e2 to your computer and use it in GitHub Desktop.
Client client = ClientBuilder.newBuilder()
.register(MultiPartFeature.class)
.build();
WebTarget target = client.target(config.getFilePath(id));
StreamDataBodyPart filePart = new StreamDataBodyPart("file", new FileInputStream(archiveFiles(files)), "a.zip");
MultiPart multipart = new FormDataMultiPart().bodyPart(filePart);
response = target.request(MediaType.APPLICATION_JSON_TYPE).post(Entity.entity(multipart, multipart.getMediaType()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment