Postman查看上传文件过程时出现400 - Required MultipartFile parameter 'files' is not present错误

我在利用postman查看上传图片文件时,出现了如下图的错误,看到之后很懵逼。

图1

上网搜了一下,归结下来就是参数不一致导致的。不过还有一些是由于没加注解,如下图示:

图2

关于参数不一致问题,主要是由于图1中“选择文件”左侧那个key值(上图中是files),与图2中第115行中的那个参数MultipartFile file 中的“file”不一致造成的。故我将key值由“files”改为"file"后,如下图示,问题解决!

 

over...

参考:

1. https://blog.csdn.net/qq_15118961/article/details/80422379

2. https://blog.csdn.net/www_hzy_com/article/details/46352723

猜你喜欢

转载自www.cnblogs.com/gjmhome/p/11334352.html
今日推荐