Retrieve JSON data from server in swift 2.1 using Alamofire 3.0

Below is an example how to retrieve JSON data from server in swift 2.1 using Alamofire 3.0.

Alamofire.request(.POST , "192.168.0.1/test", parameters: [])
            .responseJSON { response in
                if response.result.isSuccess {
                    var jsonObj = JSON(response.result.value!)
                    print(jsonObj)
                }
        }

Leave a Reply

Your email address will not be published. Required fields are marked *