Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions buffpy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def post(self, url, parser=None, **params):

headers = {'Content-Type': 'application/x-www-form-urlencoded'}

#Check if posting data and if data is unicode, encoding it as utf-8
if 'data' in params and isinstance(params['data'], unicode):
params['data'] = params['data'].encode('utf-8')


response = self.session.post(url=BASE_URL % url, headers=headers, **params)

return parser(response.content)
Expand Down