gpt4 book ai didi

ios - 无法使用 Alamofire 方案构建工作区 Alamofire

转载 作者:行者123 更新时间:2023-11-30 13:09:17 28 4
gpt4 key购买 nike

调用 Alamofireobject 映射器的正确方法吗?

有人对我的问题提出建议吗?

最佳答案

 func postRequestSample()
{
let header = [
"Content-Type": "application/x-www-form-urlencoded"
]
let URL = "http://sample.com/mappservicesia/"
let parameters = ["command":"get_tours","id":"181"]
Alamofire.request(.POST, URL, parameters: parameters, encoding: .URL, headers: header).responseObject("data"){(response: Response<TotalDict, NSError>) in

let JSON = response.result.value
print("JSON: \(JSON)")
let statusCode = (response.response?.statusCode)!
print("Status Code Success \(statusCode)")
let drive = response.result.value
if let resultarray = drive?.result {
for results in resultarray {
print(results.clientId)
print(results.comments)
}
}
}
}

关于ios - 无法使用 Alamofire 方案构建工作区 Alamofire,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38915967/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com