Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (17 sloc) 768 Bytes
#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
You can’t perform that action at this time.