From: Noel Mc grath Date: 2010-09-15T06:13:53+09:00 Subject: Re: HTTP POST Brian Candler wrote: > Noel Mc grath wrote: >> This is where the two objects are returned. Does 'net/http' and >> 'net/https' behave differently? > > I don't think so. Can you show some actual code, preferably something > which POSTs to a public HTTPS server and therefore can be run > standalone? Brian, I cannot post my example as it is currently posting to an internal endpoint at work. The following code sample (changed slightly) from http://snippets.dzone.com/posts/show/788 is the same as I am using. If you look at the HTTP response it has the following two objects - resp, responsedata. resp represents the HTTP Response class and responsedata represents the body require 'net/https' http = Net::HTTP.new('profil.wp.pl', 443) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE path = '/login.html' data = 'serwis=wp.pl&url=profil.html&tryLogin=1&countTest=1&logowaniessl=1&login_username=blah&login_password=blah' headers = { 'Referer' => 'http://profil.wp.pl/login.html', 'Content-Type' => 'application/x-www-form-urlencoded' } resp, responsedata = http.post(path, data, headers) puts 'Code = ' + resp.code puts puts 'Message = ' + resp.message puts puts 'Response data = ' + responsedata -- Posted via http://www.ruby-forum.com/.