Skip to content

Instantly share code, notes, and snippets.

@aaronpearce
Created June 3, 2011 02:38
Show Gist options
  • Save aaronpearce/1005766 to your computer and use it in GitHub Desktop.
Save aaronpearce/1005766 to your computer and use it in GitHub Desktop.
Auth grab Obj-C
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"https://www.deviantart.com/api/draft15/user/damntoken"]];
[request addRequestHeader:@"Authorization" value:[NSString stringWithFormat:@"OAuth %@", [auth accessToken]]];
NSLog(@"%@", auth );
[request startSynchronous];
NSError *error = [request error];
if (!error) {
NSString *response = [request responseString];
NSLog(@"%@", response);
} else {
NSLog(@"%@",error);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment