Skip to content

Instantly share code, notes, and snippets.

@Dimillian
Created February 29, 2012 10:40
Show Gist options
  • Save Dimillian/1939822 to your computer and use it in GitHub Desktop.
Save Dimillian/1939822 to your computer and use it in GitHub Desktop.
MSRESTRequest
@protocol MSRESTRequestDelegate;
@interface MSRESTRequest : NSObject <NSURLConnectionDelegate, RPLoginViewControllerDelegate>
{
id<MSRESTRequestDelegate>__unsafe_unretained delegate;
BOOL _sucessResponse;
BOOL _isProcessing;
BOOL _autoLoginAttempt;
NSString *_method;
NSString *_ressource;
NSArray *_parameters;
NSMutableData *_responseData;
NSURLConnection *_connection;
}
@property (nonatomic, unsafe_unretained) id<MSRESTRequestDelegate> delegate;
-(id)initWithMethod:(NSString *)method
ressource:(NSString *)ressource
parameters:(NSArray *)array
shouldEscapeParameters:(BOOL)escape;
-(void)constructRequest;
-(NSString *)constructParametersString;
-(void)executeRequest;
-(void)cancelRequest;
-(void)reset;
@end
@protocol MSRESTRequestDelegate
@required
-(void)requestDidStart;
-(void)requestDidFinishWithSuccess:(NSDictionary *)response;
-(void)requestDidFailWithError:(MSJSonError *)error;
-(void)reQuestDidFailBecauseNotLogged;
-(void)requestDidFailBecauseNoActiveConnection;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment