Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
NSURL *url = [NSURL URLWithString:@"https://api.twitter.com/1.1/statuses/user_timeline.json"];
Class socialRequestClass = NSClassFromString(@"SLRequest");
id request = nil;
if ( socialRequestClass != nil ) {
request = [socialRequestClass requestForServiceType:SLServiceTypeTwitter
requestMethod:SLRequestMethodGET
URL:url
parameters:nil];
} else {
request = [[TWRequest alloc] initWithURL:url
parameters:nil
requestMethod:TWRequestMethodGET];
}
[request setAccount:[self twitterAccount]];
[request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
if ( responseData == nil ) {
NSLog(@"%@", error);
} else {
NSError *JSONError = nil;
NSDictionary *response = [NSJSONSerialization JSONObjectWithData:responseData
options:NSJSONReadingMutableLeaves
error:&JSONError];
if ( response == nil ) {
NSLog(@"%@", JSONError);
} else {
NSLog(@"response: %@", response);
}
}
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.