encode json when sending to urllib
This commit is contained in:
parent
9128585fe8
commit
1e50a6a1b6
2 changed files with 2 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -36,3 +36,4 @@ nosetests.xml
|
|||
|
||||
virtualenv
|
||||
venv
|
||||
.DS_Store
|
||||
|
|
|
@ -284,7 +284,7 @@ def send_action(project=None, branch=None, stats=None, key=None, targetFile=None
|
|||
log.debug(data)
|
||||
|
||||
# setup api request
|
||||
request = Request(url=url, data=json.dumps(data))
|
||||
request = Request(url=url, data=str.encode(json.dumps(data)))
|
||||
request.add_header('User-Agent', get_user_agent(plugin))
|
||||
request.add_header('Content-Type', 'application/json')
|
||||
auth = unicode('Basic {key}').format(key=bytes.decode(base64.b64encode(str.encode(key))))
|
||||
|
|
Loading…
Reference in a new issue