Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…parameters.
  • Loading branch information...
commit 57703bb6db1ea85ba7127ab5c802a903c11a4d59 1 parent 589f052
@StephenWeber StephenWeber authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 mailsnake/mailsnake.py
View
5 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)
Please sign in to comment.
Something went wrong with that request. Please try again.