lib/rforce/binding.rb in rforce-0.6 vs lib/rforce/binding.rb in rforce-0.7

- old
+ new

@@ -5,11 +5,11 @@ require 'rexml/document' require 'builder' require 'oauth' module RForce - # Implements the connection to the SalesForce server. + # Implements the connection to the Salesforce server. class Binding include RForce # Increase the maximum fetch size to 2000, as allowed by Salesforce # Added by Raymond Gao @@ -92,11 +92,11 @@ end end # Log in to the server with a user name and password, remembering - # the session ID returned to us by SalesForce. + # the session ID returned to us by Salesforce. def login(user, password) @user = user @password = password response = call_remote(:login, [:username, user, :password, password]) @@ -110,12 +110,15 @@ response end # Log in to the server with OAuth, remembering - # the session ID returned to us by SalesForce. + # the session ID returned to us by Salesforce. def login_with_oauth - result = @server.post @oauth[:login_url], '', {} + result = @server.post \ + @oauth[:login_url], + '', + {'content-type' => 'application/x-www-form-urlencoded'} case result when Net::HTTPSuccess doc = REXML::Document.new result.body @session_id = doc.elements['*/sessionId'].text