比如下面这个算是很常见的了
{
"code":200,
"msg":"success",
"data":[
{
"id":1,
"name":"jack"
},
{
"id":2,
"name":"rose"
}
]
}
按照resttemplate map response to pojo关键字搜了半天居然没找到合适的方案
- 有自己封装 resttemplate util 然后用 fastjson jackson 解析的
- 有用 exchange 方法自定义 reference 解析的
- 有直接 string 然后硬解的
现在就想知道,针对这种返回体,使用 postEntity 或者 postObject 方法,resttemplate 有没有一些更优雅的处理方式?
