Created
November 2, 2012 18:20
-
-
Save wesbillman/4003341 to your computer and use it in GitHub Desktop.
SVHTTPClient
This file contains hidden or 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
- (void)setupSVHTTPClient | |
{ | |
[[SVHTTPClient sharedClient] setValue:@"test" forHTTPHeaderField:@"Client"]; | |
[[SVHTTPClient sharedClient] setValue:@"373e606658a8b539dfeeecac7f10ad33078e2ba15a80d5686ae2" forHTTPHeaderField:@"Secret"]; | |
[[SVHTTPClient sharedClient] setBasePath:@"https://server.com/api"]; | |
[[SVHTTPClient sharedClient] setSendParametersAsJSON:YES]; | |
} |
This file contains hidden or 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
NSString *url = [NSString stringWithFormat:@"/albums/%d/", album.albumId]; | |
[[SVHTTPClient sharedClient] GET:url | |
parameters:nil | |
completion:^(id response, NSHTTPURLResponse *urlResponse, NSError *error) { | |
if (error) { | |
//bad things | |
} else { | |
//good things | |
} | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment