日期:2014-05-20 浏览次数:20678 次
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> userInMap = new HashMap<String, Object>();
userInMap.put("title", titile);
Map<String, Object> bodyMap = new HashMap<String, Object>();
bodyMap.put("und", "");
userInMap.put("body", bodyMap);
jsonStr = mapper.writeValueAsString(userInMap);
{
"title":"Review",
"type":"establishment_review",
"field_establishment":[
{
"nid":{
"nid":"[nid:26686]"
}
}
],
"field_fivestar_value":[
{
"rating":"20",
"target":"0"
}
],
"field_review":[
{
"value":"comments about the restaurant"
}
]
}