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.
Example
Simple
All examples
Documentation
Read the documentation
Features
- [x] Support Swift Package Manager
- [x] Elegant APIs for people
- [x] Support HTTP Basic Authorization
- [x] Support setting SSL pinning
- [x] Support setting HTTP raw body (include JSON body)
- [x] Asynchronous & Queue
- [x] Upload files fast
- [x] Internal fully JSON support with JSONNeverDie
- [x] Support setting custom HTTP headers
- [x] almost 100% tested
Requirements
- iOS 7.0+
- Xcode 10.2 (Swift 5) (v4.x) in the default swift5 branch.
- Xcode 9 (Swift 4) (v3.x) in swift4 branch.
- Xcode 8 (Swift 3) (v2.x) in swift3 branch.
- Xcode 7 (Swift 2) (v1.x) in master branch.
- Xcode 6.4 (Swift 1.2) before v0.2.3
Installation
Swift Package Manager
You can use The Swift Package Manager to install Pitaya
by adding the proper description to your Package.swift
file:
Note that the Swift Package Manager is still in early design and development, for more infomation checkout it's GitHub Page
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:
To integrate Pitaya into your Xcode project using Carthage, specify it in your Cartfile:
Then fetch and build Pitaya:
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
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.