Ruby 获取 HTTP 回应的编码和内容 2015/04/13 14380 require 'net/http' response = Net::HTTP.get_response('www.oschina.net, '/code/list') response.code # => "200" response.body.size # => 21835 response['Content-type'] puts response.body[0,200]