Skip to content

Instantly share code, notes, and snippets.

@JohnProg
Forked from cezarcp/SwiftHTTPRequest.swift
Last active August 29, 2015 14:15
Show Gist options
  • Save JohnProg/a85f70fbe8d3f5a50d01 to your computer and use it in GitHub Desktop.
Save JohnProg/a85f70fbe8d3f5a50d01 to your computer and use it in GitHub Desktop.
//Uncomment both lines below if testing on an Xcode playground.
//import XCPlayground
//XCPSetExecutionShouldContinueIndefinitely()
let url = NSURL(string: "http://www.stackoverflow.com")
let task = NSURLSession.sharedSession().dataTaskWithURL(url) {(data, response, error) in
println(NSString(data: data, encoding: NSUTF8StringEncoding))
}
task.resume()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment