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://codercto.com/soft/d/18643.html

Head First Mobile Web

Head First Mobile Web

Lyza Danger Gardner、Jason Grigsby / O'Reilly Media / 2011-12 / $ 50.84

Despite the huge number of mobile devices and apps in use today, your business still needs a website. You just need it to be mobile. Head First Mobile Web walks you through the process of making a con......一起来看看 《Head First Mobile Web》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器