Content type 'multipart/form-data;boundary=----…;charset=UTF-8' not supported

后端 未结 5 2302
误落风尘
误落风尘 2021-01-01 21:35

I want to send an object to the controller that has several lists with files and several fields with plain text.

public class ContributionNew

        
5条回答
  •  遥遥无期
    2021-01-01 21:46

    use @ModelAttribute instead of @ResponseBody as this takes up data in key value pairs and the later is used for an object like, json. While hitting the api simply pass the multipart type and json key value pairs of the object. It works fine!

    stack overflow question on this

提交回复
热议问题