Permalink
Browse files

Default parameters shouldn't overwrite the call's explicitly defined …

…parameters.
  • Loading branch information...
1 parent 589f052 commit 57703bb6db1ea85ba7127ab5c802a903c11a4d59 @StephenWeber StephenWeber committed Mar 13, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 mailsnake/mailsnake.py
@@ -21,9 +21,10 @@ def __init__(self, apikey = '', extra_params = {}):
def call(self, method, params = {}):
url = self.base_api_url + method
- params.update(self.default_params)
+ all_params = self.default_params.copy()
+ all_params.update(params)
- post_data = urllib2.quote(json.dumps(params))
+ post_data = urllib2.quote(json.dumps(all_params))
headers = {'Content-Type': 'application/json'}
request = urllib2.Request(url, post_data, headers)
response = urllib2.urlopen(request)

0 comments on commit 57703bb

Please sign in to comment.