Mega Code Archive

 
Categories / Ruby / Network
 

Use methods associated with the object it returns to find out particulars about the HTTP (or FTP) response itself

require 'open-uri' f = open('http://www.rubyinside.com/test.txt') puts f.content_type puts f.charset puts f.last_modified