Cancel a request Alamofire

Alamofire 4 / Swift 3 / Xcode 8 You can cancel a single request as below: 1 – First get the request: let request = Alamofire.SessionManager.default.request(path!, method: .post, parameters: parameters, encoding: JSONEncoding.default, headers: createHeader()).responseJSON { response in switch response.result { case .success(let data): success(data as AnyObject?) case .failure(let error) : failure(error as NSError) } } … Read more

Alamofire returns .Success on error HTTP status codes

From the Alamofire manual: Validation By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling validate before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type. You can manually validate the status code using the validate … Read more

tech