Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
#import "DZCHostInfoApiClient.h"
#import "AFJSONRequestOperation.h"
@implementation DZCHostInfoApiClient
- (id)init {
NSURL * const baseUrl = [NSURL URLWithString:@"http://api.engin.umich.edu/hostinfo/v1/"];
self = [super initWithBaseURL:baseUrl];
if (!self) {
return nil;
}
[self registerHTTPOperationClass:[AFJSONRequestOperation class]];
// Accept HTTP Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
[self setDefaultHeader:@"Accept" value:@"application/json"];
// I'm an asshole:
[self setDefaultHeader:@"User-Agent" value:@"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.33 Safari/535.19"];
return self;
}
@end