"message": "Content type 'text/plain;charset=UTF-8' not supported",

学习springboot中的bean对象传参时,使用模拟Http接口测试工具PostMan进行测试,页面如下:

点击send后,Body中输出下面信息:

 {
    "timestamp": "2019-04-11T11:04:49.954+0000",
    "status": 415,
    "error": "Unsupported Media Type",
    "message": "Content type 'text/plain;charset=UTF-8' not supported",
    "path": "/v1/save_user"
 }

错误原因是:需要指定http头为 content-type为application/json,具体做法是把传输格式选择JSON(application/json)就可以了
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容