@PostMapping(value ="/user", consumes={MediaType.MULTIPART_FORM_DATA_VALUE })
@ResponseStatus(HttpStatus.CREATED)
public ApplicationUser createClient(@RequestBody @Valid ApplicationUserDto input,
@RequestParam(required = false) MultipartFile logo) {
return svc.registerNewClient(input, logo);
}
当我尝试从swagger-ui对其进行测试时,org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=---------------------------158650901010513877241477242870;charset=UTF-8' not supported
我想念什么吗?
因为api可以正常工作:
@PostMapping(value ="/user")
@ResponseStatus(HttpStatus.CREATED)
public ApplicationUser createClient(@RequestBody @Valid ApplicationUserDto input) {
return svc.registerNewClient(input);
}
或
@PostMapping(value ="/user")
@ResponseStatus(HttpStatus.CREATED)
public ApplicationUser createClient(@RequestParam MultipartFile logo) {
return svc.registerNewClient(logo);
}