Permalink
Browse files

Send GET request if no parameters given to Basecamp.record(s) methods

  • Loading branch information...
1 parent 34028d8 commit cdbd248110547c2c38738858b1ad6f53d0455d83 @anibalcucco committed Aug 31, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/basecamp/base.rb
View
@@ -25,7 +25,12 @@ 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)
+ headers = { "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?

0 comments on commit cdbd248

Please sign in to comment.