Created
October 10, 2016 07:40
-
-
Save mitulmanish/5af2652d9439561b72838bf971fd0554 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func queryLambdaFunction() { | |
let params = [ | |
"car1": "corola", | |
"car2": "camery" | |
] | |
Alamofire.request(.GET, "https://lgr2oati9b.execute-api.us-east-1.amazonaws.com/prod/carcomparison",parameters: params).response { (request, response, data, error) in | |
print(NSString(data: data!, encoding: NSUTF8StringEncoding)) | |
do { | |
let serverData = try NSJSONSerialization.JSONObjectWithData(data!, options: .AllowFragments) as? [String: AnyObject] | |
print(serverData) | |
} catch { | |
print("Unable to cast into NSData") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment