encoding json as utf-8 before passing to requests
This commit is contained in:
parent
4346722d2a
commit
24e54e37c6
1 changed files with 4 additions and 1 deletions
|
@ -146,9 +146,12 @@ def send_action(project=None, branch=None, key=None, targetFile=None,
|
||||||
'Authorization': auth,
|
'Authorization': auth,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# json request content
|
||||||
|
content = json.dumps(data).encode('utf-8')
|
||||||
|
|
||||||
# send action to api
|
# send action to api
|
||||||
try:
|
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:
|
except requests.exceptions.RequestException as exc:
|
||||||
exception_data = {
|
exception_data = {
|
||||||
sys.exc_info()[0].__name__: str(sys.exc_info()[1]),
|
sys.exc_info()[0].__name__: str(sys.exc_info()[1]),
|
||||||
|
|
Loading…
Reference in a new issue