Thus, programs must be written for people to read, and only incidentally for machines to execute.
Harold Abelson, "Structure and Interpretation of Computer Programs" ( S.I.C.P )
Pitaya is a Swift HTTP / HTTPS networking library for people. Inspired by Alamofire and JustHTTP.
Pita.build(HTTPMethod: .GET, url: "https://httpbin.org/get?hello=Hello%20Pitaya!")
.responseJSON { (json, response) -> Void in
print(json["args"]["hello"].stringValue) // get "Hello Pitaya!"
}
###They are all Asynchronous.
##Features
- Elegant APIs for people
- Support HTTP Basic Authorization
- Support setting SSL pinning
- Support setting HTTP raw body (include JSON body)
- Asynchronous & Queue
- Upload files fast
- Internal fully JSON support with JSONNeverDie
- 100% tested
##Requirements
- iOS 7.0+
- Xcode 6.4 (Swift 1.2) before v0.2.3
- Xcode 7 (Swift 2) in current master branch.
##Installation
###Carthage
Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate Pitaya into your Xcode project using Carthage, specify it in your Cartfile:
github "JohnLui/Pitaya"
Then fetch and build Pitaya:
carthage update
At last, add it to "Embedded Binaries" in the general panel use the "Add Other..." button. The Pitaya.framework binary file is lying in ./Carthage/Build/iOS
directory.
###Manually
git submodule add https://github.com/johnlui/Pitaya.git
open .
then drag Pitaya.xcodeproj into your Project, that's it!
If you want to run your project on devices with Pitaya, just go to PROJECT->TARGETS->[your project name]->General->Embedded Binaries, click +, select Pitaya.frameWork and click "Add".
###Source File
Clone all files in the Source
directory into your project.
##Contribution
You are welcome to fork and submit pull requests.
##License
Pitaya is open-sourced software licensed under the MIT license.