Skip to content

Commit

Permalink
Fix non-REST interface
Browse files Browse the repository at this point in the history
Send POST request only if parameters are empty
  • Loading branch information
xdmnl committed Aug 31, 2012
1 parent 34028d8 commit a8807a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/basecamp/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ def connection
# Make a raw web-service request to Basecamp. This will return a Hash of
# Arrays of the response, and may seem a little odd to the uninitiated.
def request(path, parameters = {})
response = Basecamp.connection.post(path, StringIO.new(convert_body(parameters)), "Content-Type" => content_type)
if parameters.empty?
response = Basecamp.connection.get(path, headers)
else
response = Basecamp.connection.post(path, StringIO.new(convert_body(parameters)), headers)
end

if response.code.to_i / 100 == 2
return {} if response.body.blank?
Expand Down

0 comments on commit a8807a5

Please sign in to comment.