RestClient.post "https://example.com`", {"id"=>"","name"=>params[:company_name],"frate"=>"0.005"}.to_json,{:Authorization => bearertoken},{content_type: :json, accept: :json}
我收到以下错误:
ArgumentError (wrong number of arguments (given 4, expected 2..3)):
答案 0 :(得分:1)
您已经正确传递了Authorization标头,但是将其他两个标头分开时应该分开。尝试这样:
RestClient.post "https://example.com`", {"id"=>"","name"=>params[:company_name],"frate"=>"0.005"}.to_json,{:Authorization => bearertoken ,content_type: :json, accept: :json}