0
以下是我的代碼,我正在嘗試將表單發佈到https網站。我搜索了很多次,沒有運氣。使用https時的rails post form問題
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>)
爲什麼會這樣呢?請幫助我,謝謝。