From: Jim Freeze Date: 2002-09-26T04:10:34+09:00 Subject: Re: http/net On Thu, Sep 26, 2002 at 03:20:19AM +0900, Jim Freeze wrote: > > I tried the following code, but it gave an error. > Can someone point me in the right direction? > > ================ > require 'net/http' > Net::HTTP.version_1_1 # declear to use 1.1 features. > > url0 = "http://xyz.mycompany.com" > url = "http://xyz.mycompany.com:3000/" > auth = "/scripts/isynch.dll" > account = "me" > passwd = "notmyrealpassword" > > Net::HTTP.start( url ) {|http| > response, body = http.get( auth, > 'Authorization' => 'Basic ' + ["#{account}:#{passwd}"].pack('m').strip ) > print body > } > ================ > > Oops, forgot to send the error message: ./get.rb /usr/local/lib/ruby/1.6/net/protocol.rb:469:in `new': getaddrinfo: no address associated with hostname. (SocketError) from /usr/local/lib/ruby/1.6/net/protocol.rb:469:in `connect' from /usr/local/lib/ruby/1.6/net/protocol.rb:468:in `timeout' from /usr/local/lib/ruby/1.6/net/protocol.rb:468:in `connect' from /usr/local/lib/ruby/1.6/net/protocol.rb:462:in `initialize' from /usr/local/lib/ruby/1.6/net/protocol.rb:159:in `new' from /usr/local/lib/ruby/1.6/net/protocol.rb:159:in `conn_socket' from /usr/local/lib/ruby/1.6/net/protocol.rb:148:in `connect' from /usr/local/lib/ruby/1.6/net/protocol.rb:142:in `_start' from /usr/local/lib/ruby/1.6/net/protocol.rb:128:in `start' from /usr/local/lib/ruby/1.6/net/http.rb:455:in `start' from ./get.rb:14 > Thanks > > Jim > -- Jim Freeze ---------- Programming Ruby def initialize; fun; end A language with class