The Request Serialisation, ie responseJson
changed signatures in AlamoFire 2.0. The Migration Guide explains in full, but the abbreviated version is as follows.
You now need to supply a closure which takes a request
, a response
, and a result
. The result is an enum
, which can either be .Success(Value)
or .Failure(NSData?, ErrorType)
.
So your code should look something like this:
Alamofire.request(.GET, urlString, parameters: params, encoding: .URL)
.responseJson(options: .MutableContainers) { (request, response, result) -> Void in
print(result)
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.