How to authenticate a HTTP request with oAuth for the Twitter API

Hi folks,

I need to update my app due to Twitter's API changes from v1 to v1.1

Hopefully something simple, but the request I usually perform now requires authentication.

Any suggestions how I can alter this snippet to authenticate in the HTTP request?

// Create our HTTP Client
    var loader = Ti.Network.createHTTPClient({
            timeout : 30000
    // Sets the HTTP request method, and the URL to get data from"GET", "");

Many thanks!


— asked 3 years ago by Simon Hume
  • Thats odd. I just pasted your url into my browser (no authentication) and retrieved the JSON block just fine!

    — commented 3 years ago by Nick Milner
  • you do in the browser, try and run that through an HTTP request and it just runs forever! Replace 1 in the URL with 1.1 and you'll see the difference

    — commented 3 years ago by Simon Hume
  • Ah, sorry. You need to use an OAuth client to process the twitter requests then. Try looking here

    — commented 3 years ago by Nick Milner

1 Answer

  • Hi Simon,

    please look to this Module from Marcel. It works perfect for me. In this github also special moduels for twitter and facebook. If you want to use the older variant you can use jsoauth from Griffith or birdhouse. Google is your friend.