我已经创建了具有json和请求中的文件的apachecxf-rest Web服务。我正在通过Postman测试它。无法在单个post请求中同时包含json和file。
职位申请结构:
@Path("/file/both")
@Consumes("multipart/mixed")
@Produces("text/plain")
@POST
public String addBookFile(@Multipart("thejson") JsonPOJO request, @Multipart("document")Attachment att) {
return "filename:" + att.getContentDisposition().getParameter("filename");
}
问题可能在于我如何称呼Postman的服务。
enter image description here
enter image description here