title: Api Requests with Ruby gem Typhoeus
body: <p>What is wrong with the following request?</p>
  
  <pre><code>request = Typhoeus::Request.new("http://fluidsurveys.com/api/v2/groups",
                                      method: :get,
                                      userpwd: "test_user:test_password",
                                      headers: { 'ContentType' =&gt; "application/json"})
  response = request.body
  puts response
  </code></pre>
  
  <p>This returns <code>undefined method body for #&lt;Typhoeus::Request:0x007f8e50d3b1d0&gt; (NoMethodError)</code></p>
  
  <p>The following request works fine with <code>httparty</code>:</p>
  
  <pre><code>call= "/api/v2/groups/"
  auth = {:username =&gt; "test_user", :password =&gt; "test_password"}
  url = HTTParty.get("http://fluidsurveys.com/api/v2/groups",
                     :basic_auth =&gt; auth,
                     :headers =&gt; { 'ContentType' =&gt; 'application/json' } )
  response = url.body
  puts response
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I tried this:</p>
  
  <pre><code>response = request.response
  puts response.body
  </code></pre>
  
  <p>with no luck. I receive this : <code>undefined method body for nil:NilClass (NoMethodError)</code></p>