Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
15
Task/HTTPS/Swift/https.swift
Normal file
15
Task/HTTPS/Swift/https.swift
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import Foundation
|
||||
|
||||
// With https
|
||||
let request = NSURLRequest(URL: NSURL(string: "https://sourceforge.net")!)
|
||||
|
||||
NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue()) {res, data, err in // callback
|
||||
|
||||
// data is binary
|
||||
if (data != nil) {
|
||||
let string = NSString(data: data!, encoding: NSUTF8StringEncoding)
|
||||
println(string)
|
||||
}
|
||||
}
|
||||
|
||||
CFRunLoopRun() // dispatch
|
||||
Loading…
Add table
Add a link
Reference in a new issue