MDLMendeleyAPIClient Class Reference
| Inherits from | AFOAuth1Client |
| Declared in | MDLMendeleyAPIClient.h MDLMendeleyAPIClient.m |
Tasks
-
automaticAuthenticationEnabledWhen enabled, automatic authentication launch the authentication process upon receiving network responses with status code = 401. This is
propertyYESby default. -
rateLimitRemainingForLatestRequestNumber of calls you can still do within the next hour for the latest request. This is
propertyNSNotFoundby default. Note that the default rate limit for calls varies depending on the method being requested. -
+ sharedClientCreates and initializes if needed a singleton instance of a
MDLMendeleyAPIClientobject configured with Mendeley Open API URL. -
+ resetSharedClientDeallocates the singleton instance returned by
sharedClient. -
– authenticateWithSuccess:failure:Creates an authentication request, and enqueues it to the HTTP client’s operation queue.
-
– authenticateWithWebAuthorizationCallback:success:failure:Creates an authentication request with in-app web authorization callback, and enqueues it to the HTTP client’s operation queue.
-
– getPath:requiresAuthentication:parameters:success:failure:Creates an
AFHTTPRequestOperationwith aGETrequest, and enqueues it to the HTTP client’s operation queue. -
– getPath:requiresAuthentication:parameters:outputStreamToFileAtPath:progress:success:failure:Creates an
AFHTTPRequestOperationwith aGETrequest, setup outstream to a file, and enqueues it to the HTTP client’s operation queue. -
– postPath:bodyKey:bodyContent:success:failure:Creates an
AFHTTPRequestOperationwith aPOSTrequest, and enqueues it to the HTTP client’s operation queue. -
– deletePath:parameters:success:failure:Creates an
AFHTTPRequestOperationwith aDELETErequest, and enqueues it to the HTTP client’s operation queue. -
– putPath:fileAtURL:success:failure:Creates an
AFHTTPRequestOperationwith aPUTrequest, and enqueues it to the HTTP client’s operation queue.
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 automaticAuthenticationEnabledDiscussion
When enabled, automatic authentication launch the authentication process upon receiving network responses with status code = 401. This is YES by default.
Declared In
MDLMendeleyAPIClient.hrateLimitRemainingForLatestRequest
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 rateLimitRemainingForLatestRequestDiscussion
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.
See Also
Declared In
MDLMendeleyAPIClient.hClass Methods
resetSharedClient
Deallocates the singleton instance returned by sharedClient.
+ (void)resetSharedClientDiscussion
Deallocates the singleton instance returned by sharedClient.
Declared In
MDLMendeleyAPIClient.hsharedClient
Creates and initializes if needed a singleton instance of a MDLMendeleyAPIClient object configured with Mendeley Open API URL.
+ (MDLMendeleyAPIClient *)sharedClientReturn 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.hInstance Methods
authenticateWithSuccess:failure:
Creates an authentication request, and enqueues it to the HTTP client’s operation queue.
- (void)authenticateWithSuccess:(void ( ^ ) ( AFOAuth1Token *))success failure:(void ( ^ ) ( NSError *))failureParameters
- success
A block object to be executed when the request operation finishes successfully. This block has no return value and takes one argument: the newly acquired access token.
- failure
A block object to be executed when the request operation finishes unsuccessfully. This block has no return value and takes one argument: the
NSErrorobject describing the network or authentication error that occurred.
Discussion
Creates an authentication request, and enqueues it to the HTTP client’s operation queue.
Declared In
MDLMendeleyAPIClient.hauthenticateWithWebAuthorizationCallback:success:failure:
Creates an authentication request with in-app web authorization callback, and enqueues it to the HTTP client’s operation queue.
- (void)authenticateWithWebAuthorizationCallback:(void ( ^ ) ( NSURL *))webAuthorizationCallback success:(void ( ^ ) ( AFOAuth1Token *))success failure:(void ( ^ ) ( NSError *))failureParameters
- webAuthorizationCallback
A block object to be executed when the request operation needs to switch to the web-based authorization process. This block has no return value and takes one argument: the URL for its authorization request.
- success
A block object to be executed when the request operation finishes successfully. This block has no return value and takes one argument: the newly acquired access token.
- failure
A block object to be executed when the request operation finishes unsuccessfully. This block has no return value and takes one argument: the
NSErrorobject describing the network or authentication error that occurred.
Discussion
Creates an authentication request with in-app web authorization callback, and enqueues it to the HTTP client’s operation queue.
Declared In
MDLMendeleyAPIClient.hdeletePath: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 *))failureParameters
- 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
NSErrorobject 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.hgetPath:requiresAuthentication:parameters:outputStreamToFileAtPath:progress:success:failure:
Creates an AFHTTPRequestOperation with a GET request, setup outstream to a file, and enqueues it to the HTTP client’s operation queue.
- (AFHTTPRequestOperation *)getPath:(NSString *)path requiresAuthentication:(BOOL)requiresAuthentication parameters:(NSDictionary *)parameters outputStreamToFileAtPath:(NSString *)filePath progress:(void ( ^ ) ( NSUInteger bytesRead , long long totalBytesRead , long long totalBytesExpectedToRead ))progress success:(void ( ^ ) ( AFHTTPRequestOperation *, id ))success failure:(void ( ^ ) ( NSError *))failureParameters
- 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.
- progress
A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the
NSHTTPURLResponseobject. This block may be called multiple times, and will execute on the main thread.
- 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
NSErrorobject describing the network or parsing error that occurred.
Return Value
A new HTTP request operation
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.hgetPath: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 *))failureParameters
- 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
NSErrorobject 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.hpostPath: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 *))failureParameters
- 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
NSErrorobject 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.hputPath: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 *))failureParameters
- 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
NSErrorobject 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