Appcelerator Titanium Twitter Birdhouse Failing because of HTTP

Hold on Cowboy

This blog post is pretty old. Be careful with the information you find in here. It's likely dead, dying, or wildly inaccurate.

This problem caused me much angst and it’s partly Twitter’s fault (just ask me).

I’m using the great Titanium library for Twitter called Birdhouse. It does a great job requesting authorization, storing it, and gives you an API to post tweets. So I was using this code to post tweets using Birdhouse.

this.tweet = function(message) {'Im about to post to twitter:');;
  BH.api('', 'POST', 'status=' + escape(message), function(resp) {;
    if (resp !== false) {'Twitter Post Successful');
      if (typeof(callback) == 'function') {
      return true;
    } else {'Posting to twitter failed:');
      if (typeof(callback) == 'function') {
      return false;
  }, true);

The problem with this code is that it would only work sporadically. It drove me crazying thinking maybe the access token was not getting set. Then I printed out the error from twitter and it went like this

403 Forbidden: The server understood the request, but is refusing to fulfill it.
You know what the problem was? I was** using HTTP instead of HTTPS**. It was working sometimes, but not others, and it would be sporadic.