Skip to content

Instantly share code, notes, and snippets.

@joepestro
Created July 23, 2010 00:31
Show Gist options
  • Save joepestro/486845 to your computer and use it in GitHub Desktop.
Save joepestro/486845 to your computer and use it in GitHub Desktop.
// Example using the ASIHTTPRequest library
// http://allseeing-i.com/ASIHTTPRequest/
- (IBAction)checkIn:(id)sender {
NSURL* url = [NSURL URLWithString:@"https://api.fanvibe.com/v1/checkin"];
ASIFormDataRequest* request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease];
[request setDelegate:self];
[request setRequestMethod:@"POST"];
[request setPostValue:@"107763" forKey:@"game_id"];
[request setPostValue:@"YOUR_ACCESS_TOKEN" forKey:@"access_token"];
[request setDidFailSelector:@selector(requestFailed:)];
[request setTimeOutSeconds:10];
[request startAsynchronous];
}
- (void)requestFinished:(ASIHTTPRequest*)request {
NSString* responseString = [request responseString];
}
- (void)requestFailed:(ASIHTTPRequest*)request {
NSError* error = [request error];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment