接收接口返回值

 
  def parse_url url
    uri = URI.parse(URI.encode(url))
    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = true if uri.scheme == 'https'
    tmp_url = uri.path+"?"+uri.query
    request = Net::HTTP::Get.new(tmp_url)
    response = http.request(request)
    response.body
  end

你可能感兴趣的:(接口返回值)