Created
September 7, 2014 07:34
-
-
Save anonymous/6da26c9f36d7a04d690c 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
// Playground - noun: a place where people can play | |
import UIKit | |
var str = "Hello, playground" | |
import XCPlayground | |
XCPSetExecutionShouldContinueIndefinitely(continueIndefinitely: true) | |
let url = NSURL(string: "http://yo.ngrok.com/test") | |
let urlRequest = NSURLRequest(URL: url) | |
let postData = NSData() | |
let uploadDataTask = NSURLSession.sharedSession().uploadTaskWithRequest(urlRequest, fromData: postData) { data, response, error in | |
// handle response data, response, and error | |
let json = NSJSONSerialization.JSONObjectWithData(data, options: nil, error: nil) // actually handle error | |
} | |
uploadDataTask.resume() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment