Skip to content

Instantly share code, notes, and snippets.

@wesbillman
Created November 2, 2012 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesbillman/4003341 to your computer and use it in GitHub Desktop.
Save wesbillman/4003341 to your computer and use it in GitHub Desktop.
SVHTTPClient
- (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];
}
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