【发布时间】:2023-04-02 23:35:02
【问题描述】:
我需要使用邮递员创建一个请求。 spring boot 端点是:
@RequestMapping(
value = "/group",
method = RequestMethod.POST,
consumes = MediaType.MULTIPART_FORM_DATA_VALUE
)
public ResponseEntity<String> group(
@RequestPart("items") List<ItemType> items,
@RequestPart("group") GroupType group);
地点:
public class ItemType {
private String description;
private String security;
private Date bestdate;
private MultipartFile content;
}
public class GroupType {
private String description;
private String security;
private String metadata;
}
如您所见,ItemType 包含一个MultiPartFile。
我的意思是,我需要在 "items" 和 "group" 部分上写什么:
【问题讨论】:
-
你在创作时遇到了什么问题!!!
-
我已经编辑了帖子。
-
如果您使用 json 发送请求,则 multipart 不起作用
标签: spring spring-boot postman