Spring Cloud 使用 sentinel 或eureka时,调用返回的是xml文件而不是json数据

  • 这是因为引用的jar包中引入了
    jackson-dataformat-xml  它会将数据默认转换为xml形式,只需要排除对应包中的这个jar包就可以了
       
            com.alibaba.cloud
            spring-cloud-starter-alibaba-sentinel
            
                
                    jackson-dataformat-xml
                    com.fasterxml.jackson.dataformat
                
            
        

 

你可能感兴趣的:(spring采坑日记)