How to do a http get request with Oauth token in ruby on rails
<p>I am recently doing RoR Oauth with a 3rd party API. I am struggling with how I can call the api with the token I already get. The API reference said I should do a GET request. Below are my codes right now:</p>

<pre><code>auth = "Bearer "+hash["access_token"]
uri = URI.parse("https://api.23andme.com/1/user/")
req = Net::HTTP::Get.new(uri.to_s,{'Authorization' =&gt; auth})
response = Net::HTTP.start(uri.host,uri.port){|http|
            http.request(req)
}
</code></pre>

<p>I was thinking that perhaps the "auth" variable is not correctly set.. The authorization toke is in a format of "Bearer yourToken". I am getting HTTPBadRequest for now. But by doing "curl -H" I can get the json data. Any thoughts?        </p>