【发布时间】:2014-10-06 13:13:15
【问题描述】:
我刚刚了解了 NSURLSession。我想发出 POST 请求。它需要 JSON 作为主体。
在使用 Objective-C 时,我使用了 NSDictionary,但在 swift 中,我的 Dictionary 只包含 1 种数据类型。在 swift 中实现这个的替代方法是什么?
{
"userID" : "xxxxxxxx",
"full_name" : "xxxxxxxxx",
"pob" : "xxxxxxxxxx"
"dob" : "xxxxxxxxxxx",
"status" : 3,
"phone_number" : null,
"education" : [
{
"university" : "xxxxxx",
"location": {
latitude: "xxxxxxx",
longitude: "xxxxxxxx"
},
"degree": "xxxxxx"
},
{
"university" : "xxxxxx",
"location": {
latitude: "xxxxxxx",
longitude: "xxxxxxxx"
},
"degree": "xxxxxx"
}
]
}
我真的被困住了,我已经寻找了几个小时的解决方案,但没有运气。在 google 中没有找到任何关于此的教程。
非常感谢,对不起我的英语不好。
【问题讨论】:
标签: ios objective-c json xcode swift