I am using Alamofire 4.0.1 and I want to set a timeout for my request. I tried the solutions gived in this question:
In the first case
Alamofire 5.1 includes a new way to modify the request with a closure in the initializer:
AF.request(url) { $0.timeoutInterval = 60 } .validate() .response { _ in // handle response here }