From: Keith Fahlgren Date: 2007-08-15T23:08:18+09:00 Subject: Re: post xml over https connection On 8/15/07, brad wrote: > Robert Klemme wrote: > Perhaps I'm doing something wrong. Here's what I'm trying: > > nex = Net::HTTP.new("https://127.0.0.1", port) > nex.use_ssl = true > path = '/path/to/xml_interface/' > headers = {'Content-Type' => 'text/xml'} > resp, data = nex.post(path, data, headers) (Not sure that 'data' is set correctly above...) You'll want to pass HTTP.new an address, not a URL: http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html Something like: require 'net/https' require 'uri' url = "https://127.0.0.1:7891/path/to/xml_interface" uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true if (uri.scheme == 'https') data = "foo" headers = {'Content-Type' => 'text/xml'} # warning, uri.path will drop queries, use uri.path + uri.query if you need to resp, body = nex.post(uri.path, data, headers) HTH, Keith