Created
August 12, 2016 05:40
-
-
Save feighter09/c97e5e4d83ec91e3ba8856702ae5fa34 to your computer and use it in GitHub Desktop.
This file contains 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
import Alamofire | |
import SwiftyJSON | |
import UIKit | |
class ViewController: UIViewController { | |
convenience init() { self.init(nibName: "ViewController", bundle: nil) } | |
@IBOutlet weak var label: UILabel! | |
override func viewDidLoad() | |
{ | |
super.viewDidLoad() | |
let url = "http://httpbin.org/post" | |
let params = ["param": "feighter09"] | |
NetworkClient.makeRequest(url, params: params) { json, error in | |
if let json = json where error == nil { | |
self.label.text = "Username: " + json["form"]["param"].stringValue | |
} | |
else { | |
self.label.text = "Request failed" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment