我正在尝试从 ruby 应用程序发出 POST 请求,但出现以下错误。
这是代码:
def action_reply(token,action_id,reply_text)
require 'uri'
require 'net/http'
require 'net/https'
@reply = { 'ACTION_ID' => action_id, 'text' => reply_text }.to_json
#A token is required to do this post
@token_url = 'https://example.com/reply?oauth_token=' + token
uri = URI.parse(@token_url)
response = Net::HTTP.post_form(uri,@reply)
end
我在最后一步收到错误消息:
NoMethodError (undefined method `map' for #<String:0x000000063798e8>)
知道这是为什么吗?
谢谢!