HTTPBin 0.0.2

HTTPBin 0.0.2

Ryan Baumbach 维护。



HTTPBin 0.0.2

  • Ryan Baumbach

HTTPBin Cocoapod Version Swift Version SPM Compatible License

一个针对 httpbin apiCodable 模型

将 HTTPBin 添加到您的项目中

从Gitlab克隆

  1. 从github克隆仓库并将文件直接复制,或者将其添加为git子模块。
  2. 目录中的所有文件添加到您的项目中。

用法

您想在任意位置使用Codable HTTPBin

    let networking = PequenoNetworking(baseURL: "https://httpbin.org")
    
    networking.get(endpoint: "/get",
                   parameters: nil) { (result: Result<HTTPBin, Error>) in
        let httpBin = try? result.get()
    }
    
    // or
    
    let httpBin = try? JSONDecoder().decode(HTTPBin.self, from: jsonData)

上述示例使用了来自Utensils项目PequenoNetworking,但可以在您使用Codable api进行序列化或反序列化json的任何地方使用。

测试

此项目已配置为使用fastlane运行spec。

首先,使用bundle安装所需的gem,安装Cocoapods。然后,在根项目目录中运行

$ bundle
$ bundle exec pod install

然后使用fastlane在命令行上运行所有spec

$ bundle exec fastlane integrationSpecs

建议,请求和反馈

感谢您查看“工具”页面。任何反馈、建议和评论都可以发送到:[email@protected],或者作为GitHub问题提出。