Skip to content

Instantly share code, notes, and snippets.

Created June 10, 2013 13:06
Show Gist options
  • Save anonymous/c7c87e32123e749caaa1 to your computer and use it in GitHub Desktop.
Save anonymous/c7c87e32123e749caaa1 to your computer and use it in GitHub Desktop.
require 'net/http'
#send get request to Heroku app
http = Net::HTTP.new("http://xxxxx.herokuapp.com/")
request = Net::HTTP::Get.new("/available.json")
response = http.request(request)
# error
# getaddrinfo: nodename nor servname provided, or not known (SocketError)
# curl works fine
# curl http://xxxxx.herokuapp.com/available.json
# {"available":["user1","user2"]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment