Created
June 3, 2011 02:38
-
-
Save aaronpearce/1005766 to your computer and use it in GitHub Desktop.
Auth grab Obj-C
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
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