How to Call API in swift using Alamofire
if you first time call API in your App than add it in you Info.plist <key> NSAppTransportSecurity </key> <dict> <key> NSAllowsArbitraryLoads </key> <true/> </dict> than install pod 'Alamofire' and import it like: Code : import Alamofire func callAPINoParameters() { let strURL = yourURL Alamofire. request (strURL). responseJSON { (response) in switch response. result { case . success ( let JSON): let response = JSON as ! NSDictionary print (response) break case . failure ( let error): print ( "Request failed with error: \ ( error )" ) break } } } func callAPIWithParameters() { let strURL = yourURL