尝试使用 GoogleShortener API 获取简短版本的 URL。我正在使用 AFNetworking 3.0,我收到此错误:'AnyObject 不是 'NSProxy' 的子类型
let manager = AFHTTPSessionManager()
manager.requestSerializer = AFJSONRequestSerializer()
let params = ["longUrl": "MYURL"]
manager.POST("https://www.googleapis.com/urlshortener/v1/url?key=MYKEY", parameters: params, success: {(operation: NSURLSession!,responseObject: AnyObject!) in
println("JSON" + responseObject.description)
},
failure: { (operation: NSURLSession!,error: NSError!) in
println("Error while requesting shortened: " + error.localizedDescription)
})
它在 'description' 的乞求行'println("JSON" + responseObject.description)' 上突出显示。