Skip to content

Commit

Permalink
python CI - encode request body
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma committed Oct 12, 2023
1 parent 99ef1a1 commit ed069e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CI/ghApiClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def postUrl(name, body):
request = urllib.request.Request(GH_BASE_URL + name)
request.add_header("Authorization", GH_AUTH)
request.add_header("Accept", "application/vnd.github.v3+json")
content = urllib.request.urlopen(request, body).read()
data = urllib.parse.urlencode(body).encode("utf-8")
content = urllib.request.urlopen(request, data).read()
jcont = json.loads(content)
return jcont
except urllib.error.HTTPError as e:
Expand All @@ -56,4 +57,3 @@ def postUrl(name, body):
import traceback
print(('generic exception: ' + traceback.format_exc()))
raise IOError

0 comments on commit ed069e0

Please sign in to comment.