Testing @MultipartForm RestEasy Rest Based Web Service
Does anyone know how to test the below @MultipartForm RestEasy Webservice? I'm unsure of how to setup the request to the below service, any ideas?
@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;
开发者_如何学Python }
@FormParam("filedata")
@PartType("application/octet-stream")
public void setFileData(final byte[] filedata) {
this.filedata = filedata;
}
}
Please see the following blog. Maybe this is what you are looking for: http://ankiewsky.blogspot.com/2008/07/resteasy-tips-part-1.html
This appears to be a duplicate of:
RestEasy client framework file upload
I just posted an answer with some general guidelines on how I just got this working over there.
精彩评论