jweinst1
7/9/2016 - 5:15 AM

make http get request in swift

make http get request in swift

//gets the json at some url and gets the any object
func getJSON(address:String) -> AnyObject {
    let url = NSURL(string: address)!
    let jsonData = NSData(contentsOfURL: url)!
    return try! NSJSONSerialization.JSONObjectWithData(jsonData, options: [])
}