【发布时间】:2018-12-19 21:44:44
【问题描述】:
现在我以这种方式得到响应:
response.body = {users=[{identity=poJwA, firstname=abc, lastname=abac, 电子邮件=abac@abc.com, profile_image=https://s3-us-west-2.amazonaws.com/talent-advocate/default-avatar.png}, {身份=AbwOA,名字=abcd,姓氏=efgh,电子邮件=jayhghl@o2h.com, profile_image=https://s3-us-west-2.amazonaws.com/talent-advocate/default-avatar.png}
我想用引用的字符串作为响应:
{
"data":[
{
"identity":"pdavp",
"social_media":"twitter",
"is_company":0,
"site_identity":0,
"active":1,
"created_at":{
"date":"2018-09-21 05:39:07.000000",
"timezone_type":3,
"timezone":"UTC"
}
}
]
}
这样我就可以转换成我的 JSON 对象了。
或者我可以将响应转换为不同于 API 响应的自定义模型吗?
【问题讨论】: