Skip to content

Commit

Permalink
Properly encodes parameters
Browse files Browse the repository at this point in the history
Fixes #27
  • Loading branch information
AWegnerGitHub committed Jan 23, 2017
1 parent cbddbc2 commit 9f8577b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stackapi/stackapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import datetime
import calendar
import requests.compat


class StackAPIError(Exception):
Expand Down Expand Up @@ -148,7 +149,7 @@ def fetch(self, endpoint=None, page=1, key=None, filter='default', **kwargs):
# badges/222;1306;99999
for k, value in kwargs.items():
if "{" + k + "}" in endpoint:
endpoint = endpoint.replace("{"+k+"}", ';'.join(str(x) for x in value))
endpoint = endpoint.replace("{"+k+"}", ';'.join(requests.compat.quote_plus(str(x)) for x in value))
kwargs.pop(k, None)

date_time_keys = ['fromdate', 'todate', 'since', 'min', 'max']
Expand Down

0 comments on commit 9f8577b

Please sign in to comment.