Inherits from AFOAuth1Client
Declared in MDLMendeleyAPIClient.h

Overview

MDLMendeleyAPIClient is an HTTP client preconfigured for accessing Mendeley Open API.

Tasks

Properties

automaticAuthenticationEnabled

When enabled, automatic authentication launch the authentication process upon receiving network responses with status code = 401. This is YES by default.

@property (getter=isAutomaticAuthenticationEnabled) BOOL automaticAuthenticationEnabled

Discussion

When enabled, automatic authentication launch the authentication process upon receiving network responses with status code = 401. This is YES by default.

Declared In

MDLMendeleyAPIClient.h

rateLimitRemainingForLatestRequest

Number of calls you can still do within the next hour for the latest request. This is NSNotFound by default. Note that the default rate limit for calls varies depending on the method being requested.

@property (assign, nonatomic) NSInteger rateLimitRemainingForLatestRequest

Discussion

Number of calls you can still do within the next hour for the latest request. This is NSNotFound by default. Note that the default rate limit for calls varies depending on the method being requested.

Declared In

MDLMendeleyAPIClient.h

Class Methods

sharedClient

Creates and initializes if needed a singleton instance of a MDLMendeleyAPIClient object configured with Mendeley Open API URL.

+ (MDLMendeleyAPIClient *)sharedClient

Return Value

The newly-initialized client

Discussion

Creates and initializes if needed a singleton instance of a MDLMendeleyAPIClient object configured with Mendeley Open API URL.

Declared In

MDLMendeleyAPIClient.h

Instance Methods

deletePath:parameters:success:failure:

Creates an AFHTTPRequestOperation with a DELETE request, and enqueues it to the HTTP client’s operation queue.

- (void)deletePath:(NSString *)path parameters:(NSDictionary *)parameters success:(void ( ^ ) ( AFHTTPRequestOperation *, id ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

path

The path to be appended to the HTTP client’s base URL and used as the request URL.

parameters

The parameters of the request.

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the created request operation and the deserialized JSON object created from the response data of request.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Creates an AFHTTPRequestOperation with a DELETE request, and enqueues it to the HTTP client’s operation queue.

Declared In

MDLMendeleyAPIClient.h

getPath:requiresAuthentication:parameters:outputStreamToFileAtPath:success:failure:

Creates an AFHTTPRequestOperation with a GET request, setup outstream to a file, and enqueues it to the HTTP client’s operation queue.

- (void)getPath:(NSString *)path requiresAuthentication:(BOOL)requiresAuthentication parameters:(NSDictionary *)parameters outputStreamToFileAtPath:(NSString *)filePath success:(void ( ^ ) ( AFHTTPRequestOperation *, id ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

path

The path to be appended to the HTTP client’s base URL and used as the request URL.

requiresAuthentication

A boolean value that corresponds to whether the resource requires authentication.

parameters

The parameters of the request.

filePath

The path to the file output stream to.

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the created request operation and the deserialized JSON object created from the response data of request.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Creates an AFHTTPRequestOperation with a GET request, setup outstream to a file, and enqueues it to the HTTP client’s operation queue.

Declared In

MDLMendeleyAPIClient.h

getPath:requiresAuthentication:parameters:success:failure:

Creates an AFHTTPRequestOperation with a GET request, and enqueues it to the HTTP client’s operation queue.

- (void)getPath:(NSString *)path requiresAuthentication:(BOOL)requiresAuthentication parameters:(NSDictionary *)parameters success:(void ( ^ ) ( AFHTTPRequestOperation *, id ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

path

The path to be appended to the HTTP client’s base URL and used as the request URL.

requiresAuthentication

A boolean value that corresponds to whether the resource requires authentication

parameters

The parameters of the request.

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the created request operation and the deserialized JSON object created from the response data of request.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Creates an AFHTTPRequestOperation with a GET request, and enqueues it to the HTTP client’s operation queue.

Declared In

MDLMendeleyAPIClient.h

postPath:bodyKey:bodyContent:success:failure:

Creates an AFHTTPRequestOperation with a POST request, and enqueues it to the HTTP client’s operation queue.

- (void)postPath:(NSString *)path bodyKey:(NSString *)bodyKey bodyContent:(id)bodyContent success:(void ( ^ ) ( AFHTTPRequestOperation *, id ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

path

The path to be appended to the HTTP client’s base URL and used as the request URL.

bodyKey

The key for the object to be encoded and set in the request HTTP body.

bodyContent

The object to be encoded and set in the request HTTP body.

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the created request operation and the deserialized JSON object created from the response data of request.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Creates an AFHTTPRequestOperation with a POST request, and enqueues it to the HTTP client’s operation queue.

Declared In

MDLMendeleyAPIClient.h

putPath:fileAtURL:success:failure:

Creates an AFHTTPRequestOperation with a PUT request, and enqueues it to the HTTP client’s operation queue.

- (void)putPath:(NSString *)path fileAtURL:(NSURL *)fileURL success:(void ( ^ ) ( AFHTTPRequestOperation *, id ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

path

The path to be appended to the HTTP client’s base URL and used as the request URL.

fileURL

The local URL for the object to be encoded and set in the request HTTP body.

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the created request operation and the object created from the response data of request.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Creates an AFHTTPRequestOperation with a PUT request, and enqueues it to the HTTP client’s operation queue.

Declared In

MDLMendeleyAPIClient.h