有谁知道如何测试下面的@MultipartForm RestEasy Webservice?我不确定如何设置以下服务的请求,任何想法?
@POST
@Path("/upload")
@Consumes("multipart/form-data")
public Response create(@MultipartForm FileUploadForm form) {
System.out.println("test");
return null;
}
public class FileUploadForm {
private byte[] filedata;
public FileUploadForm() {}
public byte[] getFileData() {
return filedata;
}
@FormParam("filedata")
@PartType("application/octet-stream")
public void setFileData(final byte[] filedata) {
this.filedata = filedata;
}
}
答案 0 :(得分:1)
请参阅以下博客。也许这就是你要找的东西:http://ankiewsky.blogspot.com/2008/07/resteasy-tips-part-1.html
答案 1 :(得分:0)