在用Postman调用微服务的时候,发现一直出现错误:
{
"timestamp": 1529391330656,
"status": 415,
"error": "Unsupported Media Type",
"exception": "org.springframework.web.HttpMediaTypeNotSupportedException",
"message": "Content type 'null' not supported",
"path": "/cities/4"
}
发现在controller上面都是 produces = "application/json;charset=UTF-8", consumes = "application/json;charset=UTF-8"
参数的传递只能是json的形式,于是找到解决问题的办法是,在Postman中Headers中增加
Content-Type : application/json
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
喜欢就支持一下吧
相关推荐
暂无评论内容