-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathJSONRequest.h
More file actions
46 lines (36 loc) · 1.36 KB
/
JSONRequest.h
File metadata and controls
46 lines (36 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// JsonRequest.h
//
// Created by Maxime Guilbot on 6/4/10.
// Copyright 2010 ekohe. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "JSON.h"
@class JSONRequest;
@protocol JSONRequestDelegate
- (void) jsonDidFinishLoading:(NSDictionary*)json jsonRequest:(JSONRequest*)request;
- (void) jsonDidFailWithError:(NSError*)error jsonRequest:(JSONRequest*)request;
@end
@interface JSONRequest : NSObject {
NSString *path;
NSString *method;
NSString *body;
NSArray *cookies;
NSMutableData *temp;
id <JSONRequestDelegate> delegate;
NSHTTPURLResponse *response;
}
@property (nonatomic, retain) NSString* path;
@property (nonatomic, retain) NSString* method;
@property (nonatomic, retain) NSString* body;
@property (nonatomic, retain) NSArray* cookies;
@property (nonatomic, retain) NSMutableData* temp;
@property (nonatomic, retain) NSHTTPURLResponse* response;
@property (nonatomic, assign) id <JSONRequestDelegate> delegate;
- (id) initGetWithPath:(NSString*)aPath delegate:(id<JSONRequestDelegate>)aDelegate;
- (id) initPostWithPath:(NSString*)aPath httpBody:(NSString*)aBody delegate:(id<JSONRequestDelegate>)aDelegate;
- (id) initPostWithPath:(NSString*)aPath parameters:(NSDictionary*)params delegate:(id<JSONRequestDelegate>)aDelegate;
+(NSString*) endPoint;
+(NSString*) alterUrl:(NSString*)url;
- (void) jsonFinishedLoading:(NSDictionary*)json;
@end