在郵遞員我的JSON響應看起來像這樣解析JSON ...問題用Alamofire
{
"success": 1,
"Details": {
"seller_id": "165",
"mobile_no": "9653265987",
"seller_name": "User A",
"seller_email_id": "[email protected]",
"company_name": "myCompany",
"category": "Cosmetics",
"otp": "1111"
},
"message": "Seller Already Registered!!!"
}
現在我想給基於成功是0還是1和條件所以,我想提取成功。我也想提取手機號碼。但我無法弄清楚如何做到這一點。
這是我想提出我的Alamofire職務的請求......
Alamofire.request(url, method: .post, parameters: Parameters, encoding: URLEncoding.httpBody, headers: headers)
.responseString { (response) in
if let httpResponse = response.response {
print("error \(httpResponse.statusCode)")
if httpResponse.statusCode == 200 {
//Do something
}
}
}
我沒有去通過其他用戶提出類似的問題...但無法從他們身上找到了我的問題的精確解...
您使用任何第三方用於像swiftyjson或光澤數據的序列化..? –
No..just Alamofire .. –