GitHub API 客户端 octokit.objc

码农软件 · 软件分类 · C/C++开发工具 · 2019-11-09 21:41:45

软件介绍

octokit.objc 是 Objective-CGitHub API 客户端。

OctoKit 是  Cocoa and Cocoa Touch 框架,用来与 GitHub API, 进行交互,可使用 AFNetworking,MantleReactiveCocoa

发出请求:

为了与API进行交互,您必须实例化一个 OCTClient. 这里有两种可创建无需验证客户端的方法。

  1. -initWithServer:这是实例化一个客户端的最基本的方法. 它可以接收一个 OCTServer, 用来判断是否要连接到 GitHub.com 或者GitHub Enterprise 接口。

  2. +unauthenticatedClientWithUser:这种方法和上面的相似, 但是它允许你设置一个 active 用户, 这需要有特定的请求。

采用第二种方法,我们可以获得更多操作。创建一个连接到 GitHub.com 的客户端。

OCTUser *user = [OCTUser userWithRawLogin:username server:OCTServer.dotComServer];
OCTClient *client = [OCTClient unauthenticatedClientWithUser:user];

获得客户端后,我们便可以开始抓取数据。在OCTClient 的每个请求方法会返回一个ReactiveCocoa信号这类似于一个future or promise

// Prepares a request that will load all of the user's repositories, represented
// by `OCTRepository` objects.
// Note that the request is not actually _sent_ until you use one of the
// -subscribe… methods below.
RACSignal *request = [client fetchUserRepositories];

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

Learning Web App Development

Learning Web App Development

Semmy Purewal / O'Reilly Media / 2014-3-3 / USD 29.99

Grasp the fundamentals of web application development by building a simple database-backed app from scratch, using HTML, JavaScript, and other open source tools. Through hands-on tutorials, this pract......一起来看看 《Learning Web App Development》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具