title: Executing requests in ruby using net/http
body: <p>I am trying to use net/http to get a response for API call based on an old library I dug up <a href="https://github.com/jurisgalang/facebook/blob/master/lib/facebook/graph-object.rb#L22" rel="nofollow">https://github.com/jurisgalang/facebook/blob/master/lib/facebook/graph-object.rb#L22</a></p>
  
  <pre><code>require 'net/http'
  
  API_HOST       = "graph.facebook.com"
  API_BASE_URL   = "https://#{API_HOST}"
  path           = "/boo"
  
  uri            = URI.parse "#{API_BASE_URL}#{path}"
  http           = Net::HTTP.new(uri.host, uri.port)
  res            = http.get(uri.request_uri, nil)
  </code></pre>
  
  <p>The <code>uri</code> ends up as <code>&lt;URI::HTTPS:0x0000010091fc48 URL:https://graph.facebook.com/boo&gt;</code></p>
  
  <p>This results in </p>
  
  <blockquote>
    <p>NoMethodError: undefined method `keys' for nil:NilClass</p>
  </blockquote>
  
  <p>I assumed it is because <code>dest</code> argument is obsolete: <a href="http://ruby-doc.org/stdlib-1.9.3/libdoc/net/http/rdoc/Net/HTTP.html#method-i-get" rel="nofollow">http://ruby-doc.org/stdlib-1.9.3/libdoc/net/http/rdoc/Net/HTTP.html#method-i-get</a></p>
  
  <p>So I did it without</p>
  
  <pre><code>res            = http.get(uri.request_uri)
  </code></pre>
  
  <p>Which results in</p>
  
  <blockquote>
    <p>NoMethodError: undefined method `empty?' for </p>
  </blockquote>
  
  <pre><code>#&lt;URI::HTTPS:0x0000010091fc48 URL:https://graph.facebook.com/boo&gt;
  </code></pre>
  
  <p>How can one request a response using net/http and http.get?</p>