Why am I unable to do a simple Alamofire request?

Make sure you got the latest cocoapods . To check latest pod type pod –version in terminal and make sure its 1.2.0. Even you downloaded the latest Alamofire4 with cocoapods, if your cocoapods is not latest it sometimes download previous version of Alamofire. Check this first, after that use this format :

 Alamofire.request(url, method: .post, parameters: yourParameter, encoding: JSONEncoding.default, headers: nil)
        .responseJSON { (response) in


    }

Leave a Comment