Here’s a Swift library that wraps NSURLSession providing a simplifed syntax called SwiftHTTP from Dalton Cherry.
SwiftHTTP provides a nice clean syntax for GET, POST, PUT, DELETE and HEAD requests with base URL parameter for easier RESTful API interaction. There is also support for request and repsonse serialization.
Here’s an example from the readme showing a basic GET request:
var request = HTTPTask() request.HEAD("http://domain.com/image.png", parameters: nil, success: {(response: AnyObject?) -> Void in println("The file does exist!") },failure: {(error: NSError) -> Void in println("File not found: (error)") })
You can find SwiftHTTP on Github here.