Cameron Bass Cameron Bass - 1 year ago 100
HTTP Question

HTTP request Ruby

I'm doing a tutorial online and I have a challenge to read through a text file and file the one and only name that is a Palindrome. However the file containing the names is in this url
. I'm pretty new to this http request stuff. How can I require the contents of this text file with a basic ruby program?

Answer Source

How about using Net::HTTP? (There are other libraries, but this one is built in and simple enough.)

require 'net/http'

text = Net::HTTP.get(URI(''))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download