mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-04-23 00:37:08 +00:00
Refactored http communications to be more abstract and OOP
This commit is contained in:
@@ -9,18 +9,25 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "Host.h"
|
||||
|
||||
@interface HttpResponse : NSObject
|
||||
static NSString* TAG_STATUS_CODE = @"status_code";
|
||||
static NSString* TAG_STATUS_MESSAGE = @"status_message";
|
||||
|
||||
@protocol Response <NSObject>
|
||||
|
||||
- (void) populateWithData:(NSData*)data;
|
||||
|
||||
@property (nonatomic) NSInteger statusCode;
|
||||
@property (nonatomic) NSString* statusMessage;
|
||||
@property (nonatomic) NSData* responseData;
|
||||
|
||||
+ (HttpResponse*) responseWithData:(NSData*)xml;
|
||||
|
||||
- (NSString*) parseStringTag:(NSString*)tag;
|
||||
- (BOOL)parseIntTag:(NSString *)tag value:(NSInteger*)value;
|
||||
- (BOOL) isStatusOk;
|
||||
- (BOOL) populateHost:(Host*)host;
|
||||
- (NSArray*) getAppList;
|
||||
@property (nonatomic) NSData* data;
|
||||
|
||||
@end
|
||||
|
||||
@interface HttpResponse : NSObject <Response>
|
||||
|
||||
- (void) populateWithData:(NSData*)data;
|
||||
- (void) parseData;
|
||||
- (NSString*) getStringTag:(NSString*)tag;
|
||||
- (BOOL) getIntTag:(NSString *)tag value:(NSInteger*)value;
|
||||
- (BOOL) isStatusOk;
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user