Skip to content

Instantly share code, notes, and snippets.

@dd1994
Created June 20, 2015 03:48
Show Gist options
  • Save dd1994/ca3d3165601a854f130a to your computer and use it in GitHub Desktop.
Save dd1994/ca3d3165601a854f130a to your computer and use it in GitHub Desktop.
ruby http get example
require "net/http"
require "json"
news_string = Net::HTTP.get(URI('http://node-hnapi.herokuapp.com/news'))
news = JSON.parse(news_string)
puts news
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment