PageRenderTime 45ms CodeModel.GetById 34ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

/Mobile/iPhone/StoffiRemote/StoffiRemote/RESTRequest.h

http://yet-another-music-application.googlecode.com/
C++ Header | 37 lines | 20 code | 10 blank | 7 comment | 0 complexity | d8da38e296149a0dbcddad91e2d2c245 MD5 | raw file
 1//
 2//  RestRequest.h
 3//  StoffiRemote
 4//
 5//  Created by Fredrik Gadnell on 9/18/11.
 6//  Copyright 2011 __MyCompanyName__. All rights reserved.
 7//
 8
 9#import <Foundation/Foundation.h>
10
11@class RESTRequest;
12
13@protocol RestRequestDelegate <NSObject>
14@required
15- (void)restRequest:(RESTRequest *)request didLoadResult:(id)jsonObject;
16- (void)restRequestDidFail:(RESTRequest *)request;
17@end
18
19#define kRequestTypeNone -1
20
21@interface RESTRequest : NSObject {
22    id<RestRequestDelegate> delegate;
23    
24    int requestType;
25    NSURLConnection *connection;
26    NSMutableData *receivedData;
27}
28
29@property (readwrite) int requestType;
30@property (assign) id<RestRequestDelegate> delegate;
31@property (assign) NSURLConnection *connection;
32@property (readwrite) BOOL shouldLog;
33
34+ (RESTRequest *)restRequestWithURL:(NSString *)url method:(NSString *)httpMethod delegate:(id<RestRequestDelegate>)delegate;
35
36@end
37