Skip to content

Commit

Permalink
encode request data with utf-8 (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelee2012 authored Jul 5, 2022
1 parent b7fd3fb commit 3d872e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api4jenkins/__version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# encoding: utf-8
__version__ = '1.10'
__version__ = '1.11'
__title__ = 'api4jenkins'
__description__ = 'Jenkins Python Client'
__url__ = 'https://github.com/joelee2012/api4jenkins'
Expand Down
2 changes: 2 additions & 0 deletions api4jenkins/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def api_json(self, tree='', depth=0):

def handle_req(self, method, entry, **kwargs):
self._add_crumb(kwargs)
if 'data' in kwargs and isinstance(kwargs['data'], str):
kwargs['data'] = kwargs['data'].encode('utf-8')
try:
return self.jenkins.send_req(method, self.url + entry, **kwargs)
except HTTPError as e:
Expand Down

0 comments on commit 3d872e9

Please sign in to comment.