这样的话,整个传输过程是加密传输的吗?
require 'uri'
uri = URI.parse('https://localhost/userlogin")
http = Net::HTTP.new(uri.host, uri.port)
password
http.start { http.request_post(uri.path,'text=123') {|res| print res.body } }
这样访问提示 400 The plain HTTP request was sent to HTTPS port
中间加上
http.use_ssl = true if uri.scheme == "https" # enable SSL/TLS
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
这样就可以得到接口的内容