Skip to content

Instantly share code, notes, and snippets.

@lefloh
Last active August 29, 2015 14:24
Show Gist options
  • Save lefloh/99fda8afb72d23b96443 to your computer and use it in GitHub Desktop.
Save lefloh/99fda8afb72d23b96443 to your computer and use it in GitHub Desktop.
RESTesy client using charset for file upload
WebTarget target = client.target("/some-resource");
MultipartFormDataOutput formData = new MultipartFormDataOutput();
formData.addFormData("file", fileContent, MediaType.TEXT_PLAIN_TYPE.withCharset("utf-8"));
Entity<MultipartFormDataOutput> entity = Entity.entity(formData, MediaType.MULTIPART_FORM_DATA);
Response response = target.request().post(entity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment