title: How to use basic authentication with httparty in a Rails app?
body: <p>The command line version of 'httparty' with basic authentication works simple and great:</p>
  
  <pre><code>httparty -u username:password http://example.com/api/url
  </code></pre>
  
  <p>But now I'm looking for the way I can add the basic auth to a HTTParty.get call from within a Rails app. First of all, for testing purposes, I want to hard code the login credentials in the Controller. Just to make sure it works. But I can't find any documentation or examples how you can pass these along.</p>
  
  <p>A HTTParty.get without credentials works fine:</p>
  
  <pre><code>@blah = HTTParty.get("http://twitter.com/statuses/public_timeline.json")
  </code></pre>
  
  <p>But I don't see how I can make a variation on this that accepts the <em>-u username:password</em> part.</p>
  
  <p>The next challenge for me (am very new to Ruby/Rails) is to get the user credentials from a user form and pass it along dynamically, but most important for me now it to get the hard coded version to work.</p>