Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cezarcp's full-sized avatar

Cezar Carvalho cezarcp

View GitHub Profile
@cezarcp
cezarcp / SwiftHTTPRequest.swift
Last active September 9, 2015 20:41
Making HTTP Requests in Swift
//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))
}