From: Scott Lillibridge Date: 2008-12-19T00:46:44+09:00 Subject: Re: Get Status Code of URL ------=_Part_31538_17692380.1229615680321 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Net::HTTP#start doesn't do the request require 'net/http' url = URI.parse("http://www.google.com") req = Net::HTTP.new(url.host) req.request_get("/") do |res| puts res.code end On Thu, Dec 18, 2008 at 8:06 AM, Desingurajan Aswanthaaman < desingurajan@gmail.com> wrote: > url = URI.parse("http://www.google.com/") > @req = Net::HTTP.new(url.host) > @req.start() do |req| > x = req.head(url.path) > print x > end > > It will print > # > > From Object x i am not able to get only the result (ie. Not found) > Any methods associate with x to get status code alone. > > If there is Some other way to get status code of the url, then also > please reply me... > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_31538_17692380.1229615680321--