Swift 的 HTTP 开发包 Cycles

码农软件 · 软件分类 · 网络工具包 · 2019-02-27 11:11:49

软件介绍

Cycles 是 Swift 编写的 HTTP 客户端开发包,目前还处于早起开发阶段,只支持 iOS

示例代码:

Cycle.get("https://api.github.com/user/",
    requestProcessors: [BasicAuthProcessor(username: "user", password: "pass")],
    responseProcessors: [JSONProcessor()],
    completionHandler: { (cycle, error) in
        println("\(cycle.response.statusCode)") // 200
        var header = cycle.response.valueForHTTPHeaderField("content-type")
        println("\(header)") // application/json; charset=utf-8
        println("\(cycle.response.textEncoding)") // 4
        println("\(cycle.response.text)") // {"login":"user","id":3 ...
        println("\(cycle.response.object)") // {"avatar_url" = ...
    })

本文地址:https://codercto.com/soft/d/237.html

We Are the Nerds

We Are the Nerds

Christine Lagorio-Chafkin / Hachette Books / 2018-10-2 / USD 18.30

Reddit hails itself as "the front page of the Internet." It's the third most-visited website in the United States--and yet, millions of Americans have no idea what it is. We Are the Nerds is an eng......一起来看看 《We Are the Nerds》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

SHA 加密
SHA 加密

SHA 加密工具