̃Gg[͂ĂȃubN}[Nɒlj

Ruby :: HTTP HEAD (Net::HTTP)



#!/usr/bin/ruby
 
require 'net/http'
 
http = Net::HTTP.new('www.yahoo.co.jp')
response = http.head('/')
 
# レスポンスコード
puts "response.code"
p response.code
puts ""
 
# HTTPヘッダの名前と値
response.each do |name, value|
  p name + " : " + value
end



programming/ruby/etc/net.http.head.txt