【发布时间】:2019-03-06 16:50:03
【问题描述】:
我有一个 spring-boot 应用程序,它唯一做的就是接收 http 请求。
这是我的弹簧控制器:
@RestController
public class WebController {
@Autowired
private CallRecording callRecording;
@PutMapping(path = "/cdrpostbox/callrecording/{hostedAccountId}/{mp3FileName}", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
public ResponseEntity<Object> callRecording(@PathVariable("hostedAccountId") String hostedAccountId, @PathVariable("mp3FileName") String mp3FileName, MultipartFile file) {
return ResponseEntity.status(callRecording.service(hostedAccountId, mp3FileName, file)).body(null);
}
}
我正在使用 Postman 发送请求。我的 Spring 应用程序收到的请求无法更改,因为代码不是由我的团队维护的。
我在这里发现了很多关于类似问题的问题,但与我必须解决的问题并不完全相同。我尝试添加和删除 @RequestBody ,将 @RequestBody 替换为 @RequestParam,我尝试了 MultiValueMap,但它一直返回同样的错误。
java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "x"
我什至无法调试代码,因为它在到达控制器之前就失败了。
我错过了什么?
【问题讨论】:
标签: java spring spring-boot spring-mvc postman