encoding json as utf-8 before passing to requests

This commit is contained in:
Alan Hamlett 2013-09-04 23:22:49 -07:00
parent 4346722d2a
commit 24e54e37c6

View file

@ -146,9 +146,12 @@ def send_action(project=None, branch=None, key=None, targetFile=None,
'Authorization': auth,
}
# json request content
content = json.dumps(data).encode('utf-8')
# send action to api
try:
response = requests.post(url, data=str(json.dumps(data)), headers=headers)
response = requests.post(url, data=content, headers=headers)
except requests.exceptions.RequestException as exc:
exception_data = {
sys.exc_info()[0].__name__: str(sys.exc_info()[1]),