{
"code": 0,
"message": "用户添加成功",
"data": {
"id": 82,
"name": "张三"
}
}怎么返回这种效果
string Json = "{'code':'0','message':'OK','result':[ '" + UserType + "' ,'" + Mprbdc_DbConID + "', '" + Mprbdc_DbName + "']}";
return new HttpResponseMessage { Content = new StringContent(Json, System.Text.Encoding.UTF8, "application/json") };
上面这样实现的,不过我前端页面没取出来
用PHP的自带函数
json_encode();
//可以实现
这就是json格式啊,有什么问题
我返回的效果是 {TypeID: 1, DbConID: [1, 2], DbName: ["客户1数据库", "客户2数据库"]}