Advertisement
Guest User

Untitled

a guest
Mar 13th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.84 KB | None | 0 0
  1. import UIKit
  2.  
  3. class ViewController: UIViewController {
  4.  
  5.     override func viewDidLoad() {
  6.         super.viewDidLoad()
  7.         // Do any additional setup after loading the view, typically from a nib.
  8.         let request = NSMutableURLRequest(URL: NSURL(string: "letsjam.imrapid.io/signup_manual")!)
  9.         request.HTTPMethod = "POST"
  10.         let postString = "password=123456789$&username=asaf$"
  11.         request.HTTPBody = postString.dataUsingEncoding(NSUTF8StringEncoding)
  12.         let task = NSURLSession.sharedSession().dataTaskWithRequest(request) { data, response, error in
  13.             print("responseString = \(response)")
  14.         }
  15.         task.resume()
  16.        
  17.     }
  18.  
  19.     override func didReceiveMemoryWarning() {
  20.         super.didReceiveMemoryWarning()
  21.         // Dispose of any resources that can be recreated.
  22.     }
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement