Swift 网络库:Crackers

jopen 9年前

Crackers 是简单的 Swift 网络库,支持 iOS 和 OS X。

特性

  • 支持的HTTP 方法: GET, POST, PUT, DELETE
  • 异步请求Asynchronous request
  • 大数据包的管理Management of large packets
  • 基本的HTTP验证HTTP Basic Authentication

用法

GET Request

let requestGet = Crackers(url: "http://httpbin.org/get")    requestGet.sendRequest(.GET, blockCompletion: { (data, response, error) -> () in  if (error == nil) {      println("request success ! \(response), \(data)")    }    else {      println("\(error)")    }  })

项目主页:http://www.open-open.com/lib/view/home/1419489836406