Current Path : /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/httpclient-2.8.3/sample/ |
Current File : //opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/httpclient-2.8.3/sample/wcat.rb |
#!/usr/bin/env ruby # wcat for http-access2 # Copyright (C) 2001 TAKAHASHI Masayoshi $:.unshift(File.join('..', 'lib')) require 'httpclient' if ENV['HTTP_PROXY'] h = HTTPClient.new(ENV['HTTP_PROXY']) else h = HTTPClient.new() end while urlstr = ARGV.shift response = h.get(urlstr){ |data| print data } p response.contenttype p response.peer_cert if /^https/i =~ urlstr end