I am trying to do a REST API login over HTTPS. I keep getting
Connection reset by peer (Errno::ECONNRESET):
require 'net/http' require 'net/https' uri = URI.parse("https://.../login.jsp") https = Net::HTTP.new(uri.host,uri.port) https.use_ssl = true req = Net::HTTP::Post.new(uri.path) req['userid'] = 'myemail%40hostname.com' req['passwd'] = 'mypassword' res = https.request(req) puts res.body
I'm not sure what I'm doing wrong. The corresponding cURL command that works without a hitch is:
curl --user-agent "MyUserAgent" --cookie-jar cookiefile -o - --data 'userid=myemail%40hostname.com&passwd=mypassword' https://.../login.jsp
(I haven't gotten to dealing with capturing the cookie file yet, I'm just trying to get the login to work)
Suggestions appreciated! Thanks!!