LUAPIRequest Class Reference
| Inherits from | NSObject |
| Declared in | LUAPIRequest.h LUAPIRequest.m |
Overview
LUAPIRequest represents a request to the LevelUp API. To perform a request, an LUAPIRequest
instance is passed to the performRequest:success:failure method of LUAPIClient. LUAPIRequest
instances should usually be created by request builders.
Tasks
-
apiVersionproperty -
methodproperty -
modelFactoryproperty -
pathproperty -
parametersproperty -
retryResponseCodesproperty -
retryTimeIntervalproperty -
+ apiRequestWithMethod:path:apiVersion:parameters:modelFactory: -
+ apiRequestWithMethod:path:apiVersion:parameters:modelFactory:retryResponseCodes:retryTimeInterval: -
– URL -
– URLRequest
Properties
apiVersion
The version of the LevelUp API to use for this request.
@property (nonatomic, copy) NSString *apiVersionDiscussion
The version of the LevelUp API to use for this request.
Declared In
LUAPIRequest.hmethod
The HTTP method of the request: “GET”, “POST”, “PUT”, or “DELETE”.
@property (nonatomic, copy) NSString *methodDiscussion
The HTTP method of the request: “GET”, “POST”, “PUT”, or “DELETE”.
Declared In
LUAPIRequest.hmodelFactory
An LUAbstractJSONModelFactory to parse the JSON response.
@property (nonatomic, strong) LUAbstractJSONModelFactory *modelFactoryDiscussion
An LUAbstractJSONModelFactory to parse the JSON response.
Declared In
LUAPIRequest.hparameters
An NSDictionary of values to be passed as parameters.
@property (nonatomic, copy) NSDictionary *parametersDiscussion
An NSDictionary of values to be passed as parameters.
Declared In
LUAPIRequest.hpath
The path component of the URL of the request.
@property (nonatomic, copy) NSString *pathDiscussion
The path component of the URL of the request.
Declared In
LUAPIRequest.hretryResponseCodes
An NSArray of NSNumber response codes which, if received, will cause the request
to be repeated by the LUAPIClient every retryTimeInterval, until a successful response is received.
The response codes must be defined as acceptable by http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
@property (nonatomic, copy) NSArray *retryResponseCodesDiscussion
An NSArray of NSNumber response codes which, if received, will cause the request
to be repeated by the LUAPIClient every retryTimeInterval, until a successful response is received.
The response codes must be defined as acceptable by http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Declared In
LUAPIRequest.hClass Methods
apiRequestWithMethod:path:apiVersion:parameters:modelFactory:
Returns an LUAPIRequest with the specified method, path and parameters. An authentication token
will automatically be included in the request if one is set on the LUAPIClient.
+ (LUAPIRequest *)apiRequestWithMethod:(NSString *)method path:(NSString *)path apiVersion:(NSString *)apiVersion parameters:(NSDictionary *)parameters modelFactory:(LUAbstractJSONModelFactory *)modelFactoryParameters
- method
An HTTP method: “GET”, “POST”, “PUT”, or “DELETE”.
- path
The path of the API request, e.g. “/users”.
- apiVersion
The version of the API to use.
- parameters
A dictionary of parameters to include with this request, or nil if the request has no parameters.
- modelFactory
An instance of
LUAbstractJSONModelFactorywhich will parse the response.
Discussion
Returns an LUAPIRequest with the specified method, path and parameters. An authentication token
will automatically be included in the request if one is set on the LUAPIClient.
Declared In
LUAPIRequest.hapiRequestWithMethod:path:apiVersion:parameters:modelFactory:retryResponseCodes:retryTimeInterval:
Returns an LUAPIRequest with the specified method, path and parameters. An authentication token
will automatically be included in the request if one is set on the LUAPIClient.
+ (LUAPIRequest *)apiRequestWithMethod:(NSString *)method path:(NSString *)path apiVersion:(NSString *)apiVersion parameters:(NSDictionary *)parameters modelFactory:(LUAbstractJSONModelFactory *)modelFactory retryResponseCodes:(NSArray *)retryResponseCodes retryTimeInterval:(NSTimeInterval)retryTimeIntervalParameters
- method
An HTTP method: “GET”, “POST”, “PUT”, or “DELETE”.
- path
The path of the API request, e.g. “/users”.
- apiVersion
The version of the API to use.
- parameters
A dictionary of parameters to include with this request, or nil if the request has no parameters.
- modelFactory
An instance of
LUAbstractJSONModelFactorywhich will parse the response.
- retryResponseCodes
An
NSArrayof response codes which, if received, will cause the request to be repeated by theLUAPIClientevery retryTimeInterval, until a successful response is received.
- retryTimeInterval
Duration in seconds until a request is repeated.
Discussion
Returns an LUAPIRequest with the specified method, path and parameters. An authentication token
will automatically be included in the request if one is set on the LUAPIClient.
Declared In
LUAPIRequest.h