-
Notifications
You must be signed in to change notification settings - Fork 100
Home
JohnLui edited this page Oct 9, 2015
·
20 revisions
You are recommended to use it manually.
If you drag Pitaya project into your project, you may need to import it before use it:
import Pitaya
Just give Google a hit:
Pitaya.request(.GET, url: "https://www.google.com", errorCallback: nil, callback: nil)
Pitaya.request(.GET, url: "http://httpbin.org/get", errorCallback: nil) { (data, response) -> Void in
print("Got it!")
}
Pitaya.request(.GET, url: "http://httpbin.org/get", errorCallback: nil) { (data, response) -> Void in
let string = NSString(data: data!, encoding: NSUTF8StringEncoding) as! String
print(string)
}
Pitaya.request(.GET, url: "http://httpbin.org/get", errorCallback: nil) { (data, response) -> Void in
for (i,j) in response!.allHeaderFields {
print("\(i): \(j)")
}
}