以下是我的代码,我正在尝试将表单发布到 https 站点。我用谷歌搜索了很多次都没有运气。
post_params = {
name: "Peter",
age: "26",
school: "St. Andrew Secondary"
}
uri = URI.parse('https://www.somehttps.com')
http = Net::HTTP.new(uri, "443")
http.use_ssl = true
http.post_form(uri, post_params)
但我总是得到:
NoMethodError (undefined method `post_form' for #<Net::HTTP www.somehttps.com:443 open=false>)
为什么会这样?请帮帮我,谢谢。