Skip to content
This repository was archived by the owner on Dec 4, 2018. It is now read-only.

OCTClient Methods

iRare Media edited this page Sep 22, 2013 · 4 revisions

Init

This is the designated initializer for the OCTClient class. Initializes the receiver to make requests to the given GitHub server.

- (id)initWithServer:(OCTServer *)server;

When using this initializer, the user property will not be set. +authenticatedClientWithUser:token: or +unauthenticatedClientWithUser: should typically be used instead.

Parameters

  • server - The GitHub server to connect to. This argument must not be nil.

Client with User and Token

Creates a client which will attempt to authenticate as the given user, using the given authorization token.

+ (instancetype)authenticatedClientWithUser:(OCTUser *)user token:(NSString *)token;

Note that this method does not actually perform a login or make a request to the server – it only sets an authorization header for future requests.

Parameters

  • user - The user to authenticate as. The user property of the returned client will be set to this object. This argument must not be nil.
  • token - The authorization token for the given user.

Return Value
A new client.


Client with User

Creates a client which can access any endpoints that don't require authentication.

+ (instancetype)unauthenticatedClientWithUser:(OCTUser *)user;

Parameters

  • user The active user. The user property of the returned client will be set to this object. This argument must not be nil.

Return Value
A new client.

Clone this wiki locally