-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathResponse.h
35 lines (32 loc) · 847 Bytes
/
Response.h
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
//
// Response.h
//
//
// Created by Ryan Daigle on 7/30/08.
// Copyright 2008 yFactorial, LLC. All rights reserved.
//
#ifdef __OBJC__
//setup debug only logging
#ifdef DEBUG
#define debugLog(...) NSLog(__VA_ARGS__)
#else
#define debugLog(...)
#endif
#endif
@interface Response : NSObject {
NSData *body;
NSDictionary *headers;
NSInteger statusCode;
NSError *error;
}
@property (nonatomic, retain) NSData *body;
@property (nonatomic, retain) NSDictionary *headers;
@property (assign, nonatomic) NSInteger statusCode;
@property (nonatomic, retain) NSError *error;
+ (id)responseFrom:(NSHTTPURLResponse *)response withBody:(NSData *)data andError:(NSError *)aError;
- (id)initFrom:(NSHTTPURLResponse *)response withBody:(NSData *)data andError:(NSError *)aError;
- (BOOL)isSuccess;
- (BOOL)isError;
- (BOOL)isARError;
- (void)log;
@end