Это код:
Код: Выделить всё
public void postFileMethod(String URL) {
Response response = null;
ResteasyClient client = new ResteasyClientBuilder().build();
ResteasyWebTarget target = client.target(URL);
MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create();
FileBody fileBody = new FileBody(new File("C:/sample/sample.zip"),
ContentType.MULTIPART_FORM_DATA);
entityBuilder.addPart("my_file", fileBody);
response = target.request().post(Entity.entity(entityBuilder,
MediaType.MULTIPART_FORM_DATA));
}
Код: Выделить всё
javax.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request
....
Caused by: javax.ws.rs.ProcessingException: RESTEASY003215: could not
find writer for content-type multipart/form-data type:
org.apache.http.entity.mime.MultipartEntityBuilder
Спасибо, ребята.
Подробнее здесь: https://stackoverflow.com/questions/545 ... ke-request