Skip to content

Commit ed069e0

Browse files
committed
python CI - encode request body
1 parent 99ef1a1 commit ed069e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CI/ghApiClient.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def postUrl(name, body):
3939
request = urllib.request.Request(GH_BASE_URL + name)
4040
request.add_header("Authorization", GH_AUTH)
4141
request.add_header("Accept", "application/vnd.github.v3+json")
42-
content = urllib.request.urlopen(request, body).read()
42+
data = urllib.parse.urlencode(body).encode("utf-8")
43+
content = urllib.request.urlopen(request, data).read()
4344
jcont = json.loads(content)
4445
return jcont
4546
except urllib.error.HTTPError as e:
@@ -56,4 +57,3 @@ def postUrl(name, body):
5657
import traceback
5758
print(('generic exception: ' + traceback.format_exc()))
5859
raise IOError
59-

0 commit comments

Comments
 (0)