This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface HttpClient : AFHTTPRequestOperationManager | |
+ (HttpClient *)sharedClient { | |
static HttpClient *_sharedClient = nil; | |
_sharedClient = [[HttpClient alloc] initWithBaseURL:[NSURL URLWithString:kRequestURLString]]; | |
_sharedClient.responseSerializer.acceptableContentTypes = [_sharedClient.responseSerializer.acceptableContentTypes setByAddingObject:@"text/html"]; | |
AFJSONResponseSerializer *responseSerializer = [AFJSONResponseSerializer serializerWithReadingOptions:NSJSONReadingAllowFragments]; | |
[_sharedClient setResponseSerializer:responseSerializer]; | |
return _sharedClient; | |
} |