0
新到Rails 5.1,並試圖發送淨/ HTTP和URI的PUT請求,不知道如果我正確設置參數的Rails 5.1 - 網/ HTTP PUT請求
需要把[「授權」]在頁眉
def put_function
uri = URI.parse('https://api.url.com/venues/' + ENV['VENUE_ID'] + '/request')
params = { 'email' => request.email,
'notes' => request.comments }
req = Net::HTTP::Put.new(uri)
req.body = params
req.authorization = ENV['AUTH_CODE']
p req
data = JSON.parse(req.body)
p data
end
除非你確信SSL配置錯誤,'http.verify_mode = OpenSSL的:: SSL :: VERIFY_NONE'是,一般,不是一個偉大的計劃。 –