我正试图通过使用api post请求创建内容,我正在使用httparty gem。
def initialize(token) @token = "Bearer kdkdkfvl" end def auth { AUTHORIZATION: @token } end response = HTTParty.post("url", :headers => { "Authorization" => auth}, :body => article)
NoMethodError: undefined method 剥去# ` 我被困在这里了。需要帮助
NoMethodError: undefined method
你在传递一个散列值,它需要一个字符串。
def auth @token end