Networks is a lightweight network request tool based on NSURLSession
Supported functions:
- GET
- POST
- Download
- SSL Pinning
- Network Reachability, Status and Type
Add Cartfile to your project as follows and execute carthage update
github "DingSoung/Network"
import PackageDescription
let package = Package(
name: "SPMExample",
dependencies: [
.Package(url: "https://github.com/DingSoung/Network.git", Version(0,5,0)),
]
)
Execute the request
Network.get(url: "https://DingSoung.tk:520/", success: { (data) in
}, fail: fail)
Advanced usage Example
Networks是一个轻量级的网络请求工具,基于NSURLSession
支持一下功能:
- GET
- POST
- Download
- SSL Pinning
- Network Reachability, Status and Type
在你的工程添加Cartfile如下,并执行carthage update
github "DingSoung/Network"
执行请求
Network.get(url: "https://dingsoung.tk:520/", success: { (data) in
}, fail: fail)
高级的用法参考 Example