【发布时间】:2015-01-11 03:24:38
【问题描述】:
此代码为响应和 json 返回 nil,知道问题出在哪里吗? url 是指向 api 端点的链接
import UIKit
import Alamofire
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
loadData()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func loadData(){
let url = "http://httpbin.org/get"
Alamofire.request(.GET, url).responseJSON { (request, response, json, error) in
println(request)
println(response)
println(json)
}
}
}
它返回这个
{ 网址:http://httpbin.org/get } 零 无
【问题讨论】:
-
错误告诉你什么?