2021
10-15
10-15
解决SpringBoot集成Eureka导致返回结果由json变为xml的问题
SpringBoot集成Eureka导致返回结果由json变为xml解决方案在请求的Mapping上加上produces={“application/json;charset=UTF-8”}例如:@GetMapping(value="/user-instance",produces={"application/json;charset=UTF-8"})以下是json和xml@GetMapping(value="/user-instance",produces=MediaType.APPLICATION_JSON_UTF8_VALUE)@GetMapping(value="/user-instance",produces=MediaType.APPLICATION_XML_VALUE)支...
继续阅读 >