The issue was being caused by right_http_connection
gem which is in my bundle. The following gives proper decoded response in IRB.
require 'net/http'
require 'uri'
uri = URI("http://vimeo.com/api/oembed.json?url=http://vimeo.com/69655841&width=150")
http = Net::HTTP.new(uri.host, uri.port)
res = http.get(uri.request_uri)
res.body
However, requiring right_http_connection
starts giving a gzipped response.
require 'net/http'
require 'uri'
require 'right_http_connection'
uri = URI("http://vimeo.com/api/oembed.json?url=http://vimeo.com/69655841&width=150")
http = Net::HTTP.new(uri.host, uri.port)
res = http.get(uri.request_uri)
res.body
This is a known issue and its fix has already been merged but a newer gem version containing the fix has not been released.