Making a Twitter API Request

But what goes in our request? If we take a look at the Twitter REST API 1.1 at https://dev.twitter.com/docs/api/1.1, we’ll find the call statuses/home_timeline, which is called via an HTTP GET, and which returns “a collection of the most recent Tweets and retweets posted by the authenticating user and the users they follow.” Not shown on this page, but fundamental to Twitter API calls, is the fact that we can append .json to get JSON-formatted results, or .xml to get XML. Foundation’s JSON parser is far easier to use than its XML parser, so our URL will be https://api.twitter.com/1.1/statuses/home_timeline.json. Since both Twitter and iOS 9 really want us to use SSL (in fact, it’s a requirement for the Twitter API), ...

Get iOS 9 SDK Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.