手记

spring boot + eureka 默认返回 xml 数据类型

spring boot 单体项目运行返回正常json 类型;


添加 eureka 服务注册后 返回值类型 变为xml 类型;



后查询到博客 :https://blog.csdn.net/zyb2017/article/details/80265070

最后解决方案为:

每个@RestController 类的头部添加:

       produces= "application/json;charset=UTF-8"




作者:cifer_pan
链接:https://www.jianshu.com/p/4d4b20a12665


0人推荐
随时随地看视频
慕课网APP