0

调用 Alamofireobject 映射器是否正确?

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

4

1 回答 1

0
 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)
                    }
                }
            }
        }
于 2016-08-12T10:39:49.750 回答