Prevent redirect response with Alamofire in Swift
I'm looking for example code how to prevent redirect response (status code 3xx) when request web api. I'm using Swift with Alamofire 1.2. I have tried: delegate.taskWillPerformHTTPRedirection = { (session: NSURLSession!, task: NSURLSessionTask!, response: NSHTTPURLResponse!, request: NSURLRequest!) in return nil } but not work I've also tried: https://github.com/Alamofire/Alamofire/pull/350/files and have changed my own code to: var acc = self.txtAccount.text var pwd = self.txtPassword.text var url : String = "http://10.1.0.2:8081/wordpress/wp-json/users/me" let delegate = Alamofire.Manager