先看代码 org.springframework.web.client.RestTemplate public RestTemplate() { this.messageConverters = new ArrayList(); this.errorHandler = new DefaultResponseErrorHandler(); this.headersExtractor = new RestTemplate.HeadersExtractor(); this.messageConvert
我们经常都需要封装统一JSON格式 例如以下形式 { “data”:“输出的数据”, “code”:“响应代码”, “msg”:“响应信息” } /** * Created by linli on 2017/7/31. */ public class Result<T> { String code; String msg; T data; public String getCode() { return code; } public void setCode(String code) { th