From: Daniel Schierbeck Date: 2006-06-08T23:53:35+09:00 Subject: Re: Problem constructing a url with uri Peter Hickman wrote: > a = Hash.new > a["fred"] = 42 > a["tom"] = "dick" > > x = URI::HTTP.build( {:host => "fred.com", :query => a} ) :query should be a string -- or rather, should respond to #to_str. q = {:fred => 42, :tom => 'dick'} def q.to_str collect{|name, value| "#{name}=#{value}"}.join('&') end uri = URI::HTTP.build(:host => "fred.com", :query => q) Cheers, Daniel