Reputation: 19
RestClient.post "https://example.com`", {"id"=>"","name"=>params[:company_name],"frate"=>"0.005"}.to_json,{:Authorization => bearertoken},{content_type: :json, accept: :json}
I receive the following error:
ArgumentError (wrong number of arguments (given 4, expected 2..3)):
Upvotes: 0
Views: 63
Reputation: 4216
You have passed the Authorization header correctly, but the other two headers you separeted when they should be together. Try like this:
RestClient.post "https://example.com`", {"id"=>"","name"=>params[:company_name],"frate"=>"0.005"}.to_json,{:Authorization => bearertoken ,content_type: :json, accept: :json}
Upvotes: 1