3
어떻게하면 RESTful 웹 서비스에서 POST 메서드를 작성하여 Java를 사용하여 데이터를 업로드 할 수 있는지 알 수 있습니까? smartupload 및 commons.upload는 웹 페이지에만 사용되는 것으로 나타났습니다.REST 웹 서비스에서 데이터 메서드 업로드
@Path("/upload")
class UploadResource {
@POST
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
public Response upload(byte[] input) {
// store input somewhere
return Response.ok().build();
}
}
그래서 당신은 당신의 파일이 byte[]
입니다 receieve 것입니다 : 당신이 뭔가를 쓸 수 있도록