521xueweihan / HelloGitHub

:octocat: 分享 GitHub 上有趣、入门级的开源项目。Share interesting, entry-level open source projects on GitHub.
https://hellogithub.com
92.98k stars 9.63k forks source link

【项目推荐】Swift 项目 | 轻量级的Swift网络层框架 #1556

Closed 0xjaden closed 3 years ago

0xjaden commented 3 years ago

项目推荐

provider = MoyaProvider<GitHub>()
provider.request(.zen) { result in
    switch result {
    case let .success(moyaResponse):
        let data = moyaResponse.data
        let statusCode = moyaResponse.statusCode
        // do something with the response data or statusCode
    case let .failure(error):
        // this means there was a network failure - either the request
        // wasn't sent (connectivity), or no response was received (server
        // timed out).  If the server responds with a 4xx or 5xx error, that
        // will be sent as a ".success"-ful response.
    }
}
521xueweihan commented 3 years ago

您推荐的项目,已成功发布HelloGitHub 第 58 期,并把您添加到了贡献者列表中。

欢迎继续推荐如此优秀的项目、告诉其他小伙伴加入到 HelloGitHub 项目中,没有 star 本项目的请 star 一下。谢谢 🙏